[cfe-commits] r90893 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp

John McCall rjmccall at apple.com
Tue Dec 8 14:45:53 PST 2009


Author: rjmccall
Date: Tue Dec  8 16:45:53 2009
New Revision: 90893

URL: http://llvm.org/viewvc/llvm-project?rev=90893&view=rev
Log:
Handle unresolved using decls in bare lookups.  These are not being adequately
tested.  Fixes PR5727.


Added:
    cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp
Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=90893&r1=90892&r2=90893&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Dec  8 16:45:53 2009
@@ -1346,9 +1346,9 @@
 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

Added: cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp?rev=90893&view=auto

==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp (added)
+++ cfe/trunk/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p12.cpp Tue Dec  8 16:45:53 2009
@@ -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(); }
+  };
+}





More information about the cfe-commits mailing list