llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

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

Open YuchangSu opened this issue 9 months ago • 2 comments

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

Regression since Clang 6

The test case was generated by a fuzzer.

YuchangSu avatar Feb 26 '26 08:02 YuchangSu

@llvm/issue-subscribers-c-11

Author: None (YuchangSu)

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

Regression since Clang 6

The test case was generated by a fuzzer.

llvmbot avatar Feb 26 '26 08:02 llvmbot

@llvm/issue-subscribers-clang-frontend

Author: None (YuchangSu)

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

Regression since Clang 6

The test case was generated by a fuzzer.

llvmbot avatar Feb 26 '26 08:02 llvmbot