[cfe-commits] r111300 - in /cfe/trunk: lib/CodeGen/Mangle.cpp test/CodeGenCXX/mangle.cpp

John McCall rjmccall at apple.com
Tue Aug 17 14:51:21 PDT 2010


Author: rjmccall
Date: Tue Aug 17 16:51:21 2010
New Revision: 111300

URL: http://llvm.org/viewvc/llvm-project?rev=111300&view=rev
Log:
Whoops.  Don't fall through into the overload case when mangling a
dependent call expression.


Modified:
    cfe/trunk/lib/CodeGen/Mangle.cpp
    cfe/trunk/test/CodeGenCXX/mangle.cpp

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=111300&r1=111299&r2=111300&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Tue Aug 17 16:51:21 2010
@@ -1546,8 +1546,8 @@
 
 void CXXNameMangler::mangleCalledExpression(const Expr *E, unsigned Arity) {
   if (E->getType() != getASTContext().OverloadTy)
-    mangleExpression(E);
-  // propagate arity to dependent overloads?
+    return mangleExpression(E);
+  // FIXME: propagate arity to dependent overloads?
 
   llvm::PointerIntPair<OverloadExpr*,1> R
     = OverloadExpr::find(const_cast<Expr*>(E));

Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=111300&r1=111299&r2=111300&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Tue Aug 17 16:51:21 2010
@@ -540,3 +540,20 @@
   static union { struct { union {}; }; };
   static union { struct { struct {}; }; };
 }
+
+// rdar://problem/8302148
+namespace test17 {
+  template <int N> struct A {};
+
+  struct B {
+    static int foo(void);
+  };
+
+  template <class T> A<sizeof(T::foo())> func(void);
+
+  // CHECK: define i32 @_ZN6test174testEv()
+  // CHECK: call {{.*}} @_ZN6test174funcINS_1BEEENS_1AIXszclsrT_3fooEEEEv()
+  int test() {
+    func<B>();  // { dg-error "sorry, unimplemented" }
+  }
+}





More information about the cfe-commits mailing list