llvm / llvm/llvm-project

_Atomic auto and _Atomic(auto) are not the same thing in C23

Open
#202,369 1 comment 1 reaction 0 assignees View on GitHub
c23 clang:frontend diverges-from:gcc
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

_This comes from discussion in https://github.com/llvm/llvm-project/pull/197874#pullrequestreview-4389392176_

`_Atomic auto` is using `_Atomic` as a qualifier, while `_Atomic(auto)` is a type specifier spelling. The qualifier form should be accepted in C23 mode but Clang rejects the same as the type specifier form: https://godbolt.org/z/1453Yz4r5

Contributor guide

Open the contributing guide

Research direction

Reproduce the distinction between `_Atomic auto` and `_Atomic(auto)` in C23 mode using the Godbolt example linked in the issue. Read the discussion in LLVM pull request 197874 to understand the intended parsing and semantics. Done means the qualifier spelling is accepted while the type-specifier spelling retains its distinct behavior, with regression coverage for both forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.