https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126323
Bug ID: 126323
Summary: ICE when parsing #pragma GCC novector inside a class
definition before a for statement
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: s.kimura.h41104 at gmail dot com
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/zG55d1Kjo
Reproducer:
```
class C {
#pragma GCC novector
for (int i = 0; i < 2; i++)
;
};
```
Backtrace:
<source>:3:12: internal compiler error: tree check: expected tree that contains
'decl with visibility' structure, have 'parm_decl' in start_decl, at
cp/decl.cc:6658
3 | for (int i = 0; i < 2; i++)
| ^
0x2b4dc08 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x2b4284b internal_error(char const*, ...)
???:0
0xa391e9 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
???:0
0xd90413 c_parse_file()
???:0
0xf22c69 c_common_parse_file()
???:0
This ICE goes back to gcc-14:
https://godbolt.org/z/x1d57xosP