llvm / llvm/llvm-project

[Clang] accepts malformed attribute syntax [[X1(])]]

Open
#183,473 2 comments 0 reactions 0 assignees View on GitHub
accepts-invalid c++11 c23 clang:frontend confirmed generated by fuzzer
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The code contains malformed C++11 attribute syntax with mismatched brackets/parentheses: [[ X1 ( ] ) ] ] ;. GCC rejects it, but Clang accepts it.

Code:
```
[ [ X1 ( ] ) ] ] ;
```
See Compiler Explorer: [https://godbolt.org/z/Td6nrxW6z](https://godbolt.org/z/Td6nrxW6z)

Regression since Clang 6

The test case was generated by a fuzzer.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.