Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

clang rejects valid code that uses _Atomic #48742

Closed
Assignees
AaronBallman
Labels
bugzillaIssues migrated from bugzillac11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyrejects-valid
@afd

Description

@afd
mannequin
Bugzilla Link49398
Versiontrunk
OSLinux
AttachmentsValid 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 bugzillac11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyrejects-valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp