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: "rs2740 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 14 Mar 2015 06:52:49 +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
TC <rs2740 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rs2740 at gmail dot com
--- Comment #5 from TC <rs2740 at gmail dot com> ---
Somewhat related: http://stackoverflow.com/questions/28955859
struct Foo {
enum { bar };
explicit Foo(int){}
};
struct Baz { explicit Baz(Foo){} };
Baz b(Foo(Foo::bar)); // 1
Line #1 should be ill-formed because it fits the grammar for a function
declaration and is disambiguated as such. GCC considers it a variable
declaration instead. Clang rejects it - see
https://llvm.org/bugs/show_bug.cgi?id=4594.