From 327f0f4c3a5ec6e5689cb5552a9aa124272335bf Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Tue, 18 Mar 2008 02:02:04 +0000 Subject: [PATCH] Fix rewriter generates invalid C code when no selector found. llvm-svn: 48479 --- clang/Driver/RewriteTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp index 4f27ab900571..239fa2d0266d 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());