This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60927] Ambiguity not caught when name introduced through using-directive conflicts with previously declared entity
- From: "mbos at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Apr 2014 22:27:19 +0000
- Subject: [Bug c++/60927] Ambiguity not caught when name introduced through using-directive conflicts with previously declared entity
- Auto-submitted: auto-generated
- References: <bug-60927-4 at http dot gcc dot gnu dot org/bugzilla/>
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.