This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/68262] New: Ill-formed function pointer declaration acts as multi-line comment until ;
- From: "yaghmour.shafik at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 09 Nov 2015 22:05:02 +0000
- Subject: [Bug c++/68262] New: Ill-formed function pointer declaration acts as multi-line comment until ;
- Auto-submitted: auto-generated
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.