-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Labels
cclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partyrejects-valid
Description
Hi,
when preparing for standardization in WG14 of this feature we ran into an inconsistency with gcc.
For declarations with __auto_type gcc accepts all C qualifiers in a reasonable way, whereas clang refuses restrict and _Atomic. The diagnostics that clang gives seem to indicate that these have simply not yet been considered
restrict requires a pointer or reference ('__auto_type' is invalid)
_Atomic cannot be applied to type '__auto_type' which is not trivially copyable
A small example that compiles with gcc but not with clang:
int main() {
double x = 37;
// clang doesn't accept that
__auto_type restrict xr = &x;
restrict __auto_type rx = &x;
__auto_type _Atomic xa = x;
_Atomic __auto_type ax = x;
}Thanks
Jens
Metadata
Metadata
Assignees
Labels
cclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partyrejects-valid