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++/60927] Ambiguity not caught when name introduced through using-directive conflicts with previously declared entity


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60927

Maurice Bos <mbos at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mbos at google dot com

--- Comment #1 from Maurice Bos <mbos at google dot com> ---
Some interesting related test cases:

namespace N { struct A {}; }
namespace A {}
using namespace N;
A * x;
int main() {}

G++ correctly complains about ambiguity. When the two lines with 'N' are
removed, it complains that A is not a type. (As expected.)

Very similar test case:

#include <memory>
namespace N { struct A {}; }
namespace A {}
using namespace N;
std::unique_ptr<A> x; // Only this line is different.
int main() {}

G++ does not complain about ambiguity, but gives the same error as when the two
lines with 'N' are removed.


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