llvm / llvm/llvm-project

[Clang] Clang incorrectly accepts `volatile volatile;` as a statement

Open
#185,831 5 comments 0 reactions 0 assignees View on GitHub
accepts-invalid clang:diagnostics diverges-from:gcc
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Clang accepts the following C program without any diagnostics:

```
int a() {
volatile volatile;
}
int main() {}
```

GCC correctly rejects this one. Please refer to the link: https://godbolt.org/z/eq6e8o67o

Contributor guide

Open the contributing guide

Research direction

Start by compiling the C reproducer from the issue with Clang and GCC, and compare the diagnostics with the linked Godbolt example. No source file or test is named; the work is done when Clang rejects `volatile volatile;` as a statement with an appropriate diagnostic.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.