https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124251
Bug ID: 124251
Summary: Accepts invalid attribute pack expansion without
parameter pack
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: suyuchang at whu dot edu.cn
Target Milestone: ---
GCC accepts code that uses ... in an attribute without any parameter pack. The
program is ill-formed and should be rejected. Clang rejects it. GCC only warns
and accepts it.
Code:
[ [ X1 :: X0 ( ) ... ] ];
Command:
g++ -c test.cpp
Output:
<source>:1:1: warning: attribute ignored [-Wattributes]
1 | [ [ X1 :: X0 ( ) ... ] ];
| ^~~~~~~~~~~~~~~~~~~~~~~~~
While Clang rejects it "error: attribute 'X0' cannot be used as an attribute
pack"
Regression since GCC 12.1
The test case was generated by a fuzzer.