Handle unresolved using decls in bare lookups. These are not being adequately

tested.  Fixes PR5727.

llvm-svn: 90893
This commit is contained in:
John McCall 2009-12-08 22:45:53 +00:00
parent 8775727b39
commit 3a60c87a59
2 changed files with 16 additions and 3 deletions
clang
lib/Sema
test/CXX/dcl.dcl/basic.namespace/namespace.udecl

View File

@ -1346,9 +1346,9 @@ Sema::OwningExprResult
Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS,
LookupResult &R,
bool NeedsADL) {
// If this isn't an overloaded result and we don't need ADL, just
// build an ordinary singleton decl ref.
if (!NeedsADL && !R.isOverloadedResult())
// If this is a single, fully-resolved result and we don't need ADL,
// just build an ordinary singleton decl ref.
if (!NeedsADL && R.isSingleResult())
return BuildDeclarationNameExpr(SS, R.getNameLoc(), R.getFoundDecl());
// We only need to check the declaration if there's exactly one

View File

@ -0,0 +1,13 @@
// RUN: clang -fsyntax-only -verify %s
// PR5727
namespace test0 {
template<typename> struct RefPtr { };
template<typename> struct PtrHash {
static void f() { }
};
template<typename T> struct PtrHash<RefPtr<T> > : PtrHash<T*> {
using PtrHash<T*>::f;
static void f() { f(); }
};
}