-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac11clang: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
| Bugzilla Link | 49398 |
| Version | trunk |
| OS | Linux |
| Attachments | Valid C program that clang rejects |
| CC | @DougGregor,@zygoloid |
Extended Description
Command (where ex.c is the attached file):
clang -std=c17 -c ex.c
LLVM revision from which clang was built: 493f140
Expected behaviour: the program should compile successfully.
Actual behaviour: clang gives this error:
ex.c:3:7: error: initializing 'int' with an expression of incompatible type '_Atomic(int)'
The program is successfully compiled by gcc 9.3.0.
The program in the attached file is:
void foo() {
_Atomic int x;
int y = (x = 2);
}
which I believe is valid: it's fine to initialize a non-atomic int using an atomic int.
If the declaration of y is changed to:
int y = x;
then the program compiles successfully.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac11clang: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