This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/62116] Allowing redeclaration of global variable x using ::x
- 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: Wed, 13 Aug 2014 15:29:38 +0000
- Subject: [Bug c++/62116] Allowing redeclaration of global variable x using ::x
- Auto-submitted: auto-generated
- References: <bug-62116-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62116
--- Comment #2 from Shafik Yaghmour <yaghmour.shafik at gmail dot com> ---
I am happy to be mistaken here, but it seems like section 6.8 paragraph 1
applies, for example if we have the following:
int(y) = 10;
it is being treated as a declaration not a cast and further more section 6.8
comments on an ill-formed example and says:
This is of course ill-formed for semantic reasons, but that does not affect the
syntactic analysis.
so even though:
int(::x);
would be ill-formed we are forced to treat it as a declaration and not a
function style cast.