This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/62116] Allowing redeclaration of global variable x using ::x


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]