]> granicus.if.org Git - clang/commitdiff
Handle unresolved using decls in bare lookups. These are not being adequately
authorJohn McCall <rjmccall@apple.com>
Tue, 8 Dec 2009 22:45:53 +0000 (22:45 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 8 Dec 2009 22:45:53 +0000 (22:45 +0000)
tested.  Fixes PR5727.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90893 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp
test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp [new file with mode: 0644]

index 4920206b25931cdad662a94139bd3846c9a34303..b284f83074cc2cab810270a1c96499c42a1537d2 100644 (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
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 (file)
index 0000000..9386e6c
--- /dev/null
@@ -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(); }
+  };
+}