]> granicus.if.org Git - clang/commitdiff
Fix <rdar://problem/5716940> rewriter generates invalid C code when no selector found.
authorSteve Naroff <snaroff@apple.com>
Tue, 18 Mar 2008 02:02:04 +0000 (02:02 +0000)
committerSteve Naroff <snaroff@apple.com>
Tue, 18 Mar 2008 02:02:04 +0000 (02:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48479 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteTest.cpp

index 4f27ab900571e0a57a028424c9cb962b55f73b7b..239fa2d0266da16c9f8799593336829759e32966 100644 (file)
@@ -2074,7 +2074,8 @@ Stmt *RewriteTest::SynthMessageExpr(ObjCMessageExpr *Exp) {
   // Now do the "normal" pointer to function cast.
   QualType castType = Context->getFunctionType(returnType, 
     &ArgTypes[0], ArgTypes.size(),
-    Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : false);
+    // If we don't have a method decl, force a variadic cast.
+    Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : true);
   castType = Context->getPointerType(castType);
   cast = new CastExpr(castType, cast, SourceLocation());