https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86185
Bug ID: 86185 Summary: gcc does not reject the ill-formed code Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- gcc++ does not produce any errors when it compiles the following code: template<typename T> void f() { auto i = T(), j = 0; } int main() { f<long>(); f<int>(); } The code comes from a bug report of clang: https://bugs.llvm.org/show_bug.cgi?id=9276 Johannes Schaub analyzed why clang shall reject the code. Shall gcc also reject the code?