-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:edgDoes the clang frontend diverge from edg compiler on this issueDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issue
Description
This program
long nil = 0;
struct S {
operator long &&() const {
return static_cast<long&&>(nil);
}
};
int main() {
int &&a((S()));
return a;
}is accepted by GCC, EDG and MSVC. But not in Clang:
error: no viable conversion from 'S' to 'int'
Online demo: https://gcc.godbolt.org/z/M7W3oYsGz
This is a slightly modified example from https://stackoverflow.com/q/79885636/7325599
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:edgDoes the clang frontend diverge from edg compiler on this issueDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issue