summaryrefslogtreecommitdiffstats
path: root/clang/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-03-18 02:02:04 +0000
committerSteve Naroff <snaroff@apple.com>2008-03-18 02:02:04 +0000
commit327f0f4c3a5ec6e5689cb5552a9aa124272335bf (patch)
treec1e9ea672898120f99efc9118715d9b8700562a3 /clang/Driver/RewriteTest.cpp
parent69683fa5ee572640c604505df8083df7c9939dee (diff)
downloadbcm5719-llvm-327f0f4c3a5ec6e5689cb5552a9aa124272335bf.tar.gz
bcm5719-llvm-327f0f4c3a5ec6e5689cb5552a9aa124272335bf.zip
Fix <rdar://problem/5716940> rewriter generates invalid C code when no selector found.
llvm-svn: 48479
Diffstat (limited to 'clang/Driver/RewriteTest.cpp')
-rw-r--r--clang/Driver/RewriteTest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp
index 4f27ab90057..239fa2d0266 100644
--- a/clang/Driver/RewriteTest.cpp
+++ b/clang/Driver/RewriteTest.cpp
@@ -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());
OpenPOWER on IntegriCloud