aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-08 22:45:53 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-08 22:45:53 +0000
commitfead20c1de136b5a199a5cc4225f64be771452e4 (patch)
treede959b6e2dd6ba2bb4481765e0b960033aa1139a
parentbc3fd65c4c37d3bdadf00ed540efd7a5460b2f20 (diff)
Handle unresolved using decls in bare lookups. These are not being adequately
tested. Fixes PR5727. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90893 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaExpr.cpp6
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp13
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 4920206b25..b284f83074 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -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
diff --git a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp
new file mode 100644
index 0000000000..9386e6c025
--- /dev/null
+++ b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp
@@ -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(); }
+ };
+}