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

qualifiers for auto_type in C #53652

Closed
Closed
Labels
cclang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyrejects-valid
@gustedt

Description

@gustedt

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 refusesrestrict 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:

intmain() {doublex=37;// clang doesn't accept that__auto_type restrictxr=&x;  restrict__auto_typerx=&x;__auto_type _Atomicxa=x;   _Atomic__auto_typeax=x;}

Thanks
Jens

Metadata

Metadata

Assignees

No one assigned

    Labels

    cclang: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