[llvm-bugs] [Bug 45216] CLANG including struct names when looking up namespace name candidates
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Mar 16 17:47:30 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45216
Richard Smith <richard-llvm at metafoo.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|NEW |RESOLVED
--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
This is a GCC bug. The lookup for the name on the left of :: "considers only
namespaces, types, and templates whose specializations are types" according to
the C++ standard, so following the normal unqualified lookup rules it should
find both the namespace ::N1 and the struct N2::N1.
Modified example showing why lookup to the left of :: should consider types:
namespace N1 {
const char* f();
}
namespace N2 {
struct X {
static const char* f();
};
using N1 = X;
}
using namespace N2;
using N1::f; // Clang: ambiguous, GCC: N1::f (OK)
struct Q : N2::N1 {
using N1::f; // Clang: ambiguous, GCC: N1::f (error)
};
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200317/36c0343d/attachment.html>
More information about the llvm-bugs
mailing list