Bug 30800 - Accepts invalid on 4.0.1
Summary: Accepts invalid on 4.0.1
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-14 22:31 UTC by Chris Jefferson
Modified: 2007-02-14 22:36 UTC (History)
2 users (show)

See Also:
Host: i686-apple-darwin8
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jefferson 2007-02-14 22:31:00 UTC
g++ compiles the following program:

void f() {}

int main(void)
{ foobar:f(); }

This problem arose from writing a single : instead of :: for a namespace. I can't find any correct meaning for this code, and accepting means people might accidentally not get the namespace function they wanted. Am I missing something?
Comment 1 Andrew Pinski 2007-02-14 22:34:30 UTC
This is way defined valid code, even though it might look a bit weird at first glance.
foobar here is a label and nothing more.
Comment 2 Chris Jefferson 2007-02-14 22:36:02 UTC
Ah, sorry, you are right. I stared at this for ages trying to figure out what it could mean. Sorry.