[Bug c++/96364] ICE on valid code in cp_finish_decl with auto return type and double attributes
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 30 23:03:25 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96364
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ICE on valid code in |ICE on valid code in
|cp_finish_decl, at |cp_finish_decl with auto
|cp/decl.c:7537 |return type and double
| |attributes
Keywords| |rejects-valid
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Full testcase:
```
auto a[[]] [[]]();
auto a() {}
void g()
{
return a();
}
```
[[]][[]] is causing GCC to think a is a variable decl and not a function decl.
This was even true before Jason's r240756 .
It is even a rejects valid with:
```
void a[[]] [[]]();
void a() {}
void g()
{
return a();
}
```
Which gives:
```
<source>:2:6: error: variable or field 'a' declared void
2 | void a[[]] [[]]();
| ^
```
and that is not a regression as 4.8.1 even rejects it with that message.
More information about the Gcc-bugs
mailing list