https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68262
Bug ID: 68262 Summary: Ill-formed function pointer declaration acts as multi-line comment until ; Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yaghmour.shafik at gmail dot com Target Milestone: --- Given the following code: #include <iostream> int main() { void (*) {} We could go on and on line after line and no errors? ; std::cout << "hello\n" ; } live example here http://melpon.org/wandbox/permlink/iWzF2dKUBxZ3NOMn What looks like an ill-formed function pointer declaration does not generate a diagnostic and allows complete none sense until a ; is reached. After that the compiler seems to go on as if nothing odd has happened. This seems to go back as far as 4.4.7 and version 4.3.6 does not seem to have this bug.