]> granicus.if.org Git - clang/commitdiff
PR7971: Compute the correct type for an address-of expression containing an
authorEli Friedman <eli.friedman@gmail.com>
Tue, 24 Aug 2010 05:23:20 +0000 (05:23 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 24 Aug 2010 05:23:20 +0000 (05:23 +0000)
UnresolvedMemberExpr.

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

lib/Sema/SemaExpr.cpp
test/SemaCXX/addr-of-overloaded-function.cpp

index 46e2745b21aafef52ee783e2b42dd115489b8b6d..9bff8f3a748e43bc54621864da01fe22e71e644f 100644 (file)
@@ -6271,7 +6271,7 @@ QualType Sema::CheckAddressOfOperand(Expr *op, SourceLocation OpLoc) {
     // FIXME: Can LHS ever be null here?
     if (!CheckAddressOfOperand(CO->getTrueExpr(), OpLoc).isNull())
       return CheckAddressOfOperand(CO->getFalseExpr(), OpLoc);
-  } else if (isa<UnresolvedLookupExpr>(op)) {
+  } else if (isa<OverloadExpr>(op)) {
     return Context.OverloadTy;
   } else if (dcl) { // C99 6.5.3.2p1
     // We have an lvalue with a decl. Make sure the decl is not declared
index f8b00df17314e856dc7022973fabca9060ed9e62..b581b8a3f64908f117891bb910bbfe61c169cc41 100644 (file)
@@ -86,3 +86,13 @@ namespace test0 {
     myFunction(bar);
   }
 }
+
+namespace PR7971 {
+  struct S {
+    void g() {
+      f(&g);
+    }
+    void f(bool (*)(int, char));
+    static bool g(int, char);
+  };
+}