https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67017
Bug ID: 67017
Summary: Mixing init-declarator for variables and functions in
declaration with auto type-specifier
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: anders.granlund.0 at gmail dot com
Target Milestone: ---
Consider the following program (prog.cc):
auto i = 0, f();
int main() {}
Compile it with the following command line:
g++ prog.cc -std=c++14 -pedantic-errors
No error messages are given. I expect to get at least one error message since
the program is ill-formed.
The program is ill-formed by [decl.spec.auto]/8:
http://eel.is/c++draft/dcl.dcl#dcl.spec.auto-8
"If the init-declarator-list contains more than one init-declarator, they
shall all form declarations of variables."
I have tried this with gcc HEAD 6.0.0 20150725 here:
http://melpon.org/wandbox/permlink/UaCnMgfMlG9nDqf3