https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51405
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Host|ubuntu 11.10 | Known to fail| |9.1.0 Keywords| |rejects-valid Last reconfirmed|2011-12-04 00:00:00 |2021-7-23 Summary|Passing method result to |[9/10/11/12 Regression] |constructor treated as |Passing method result to |function declaration |constructor treated as | |function declaration Target Milestone|--- |9.5 Target|i386 | --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- We started to reject the code in GCC 9 with: <source>: In function 'int main()': <source>:43:8: error: trailing return type only available with '-std=c++11' or '-std=gnu++11' 43 | A a (B::Instance ()->Something ()); | ^ And if I use -std=c++11 we get: <source>: In function 'int main()': <source>:43:8: error: 'parameter' function with trailing return type not declared with 'auto' type specifier 43 | A a (B::Instance ()->Something ()); | ^ In GCC 8.0 and before we do get the incorrect code gen. I suspect this regressed when the start of the C++11 support (-std=c++0x) was added to the parser.