[LLVMbugs] [Bug 11758] New: declarations made visible by using-directive are hidden by namespace members during unqualified name lookup
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Jan 13 06:03:39 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=11758
Bug #: 11758
Summary: declarations made visible by using-directive are
hidden by namespace members during unqualified name
lookup
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: zilla at kayari.org
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
namespace N
{
void f();
void g();
void h();
namespace { void f(int) { } }
namespace unique { }
using namespace unique;
namespace unique { void g(int) { } }
}
void N::h() {
f(1);
g(1);
}
c.cc:16:3: error: no matching function for call to 'f'
f(1);
^
c.cc:3:8: note: candidate function not viable: requires 0 arguments, but 1 was
provided
void f();
^
c.cc:17:3: error: no matching function for call to 'g'
g(1);
^
c.cc:4:8: note: candidate function not viable: requires 0 arguments, but 1 was
provided
void g();
^
2 errors generated.
The using-directive should mean unique::g is considered a member of N for the
purposes of unqualified name lookup, [basic.lookup.unqual]/2.
The unnamed namespace should behave the same, [namespace.unnamed]/1.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list