]> granicus.if.org Git - clang/commitdiff
Change diagnostic test for my last patch.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 2 Mar 2012 17:05:03 +0000 (17:05 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 2 Mar 2012 17:05:03 +0000 (17:05 +0000)
// rdar://10961370

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

lib/Sema/SemaExpr.cpp
test/Sema/variadic-incomplete-arg-type.c

index ece16e88504f4e01158a83f21a4cd4bde39e0628..1bab239ab32aad272c6fd93d5231868508dc7dc3 100644 (file)
@@ -587,11 +587,10 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT,
       E = Comma.get();
     }
   }
-  // c++ rules are enfroced elsewhere.
+  // c++ rules are enforced elsewhere.
   if (!getLangOptions().CPlusPlus &&
-      !E->getType()->isVoidType() &&
       RequireCompleteType(E->getExprLoc(), E->getType(),
-                          diag::err_incomplete_type))
+                          diag::err_call_incomplete_argument))
     return ExprError();
   
   return Owned(E);
index 1306173a0ef5412208aa8dcef3b46af64616a72b..2b5dd1ab9d4865effe6a0fa2097c5fe1fb361bfc 100644 (file)
@@ -8,5 +8,6 @@ void junk(int, ...);
 int main()
 {
  CFErrorRef error;
- junk(1, *error); // expected-error {{incomplete type 'struct __CFError' where a complete type is required}}
+ junk(1, *error, (void)0); // expected-error {{argument type 'struct __CFError' is incomplete}} \
+                           // expected-error {{argument type 'void' is incomplete}}
 }