]> granicus.if.org Git - clang/commitdiff
Ok, ok, I give in. Fix tests for unused result warning.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 1 Aug 2009 06:07:15 +0000 (06:07 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 1 Aug 2009 06:07:15 +0000 (06:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77780 91177308-0d34-0410-b5e6-96231b3b80d8

test/Parser/statements.c
test/Sema/enum.c
test/SemaCXX/decl-expr-ambiguity.cpp

index a55b2c23f6c9f372c1d8b022f12e79d7e85f7868..25e06a27bd139591eb0455a9dd8448841998942f 100644 (file)
@@ -11,11 +11,11 @@ void test2() {
   
   while (0) while(0) do ; while(0);
 
-  for (0;0;0)
+  for ((void)0;0;(void)0)
     for (;;)
-      for (9;0;2)
+      for ((void)9;0;(void)2)
         ;
-  for (int X = 0; 0; 0);
+  for (int X = 0; 0; (void)0);
 }
 
 void test3() {
index adb9375512371f2310359a86a1d5f1386b877e8a..31649e0ae9edc8738ab4e9afa336aedfc72c8369 100644 (file)
@@ -43,7 +43,7 @@ void test4() {
     ;
   (_Bool)ve2;  // expected-error {{arithmetic or pointer type is required}}
 
-  for (; ;ve2)
+  for (; ;ve2) // expected-warning {{expression result unused}}
     ;
   (void)ve2;
   ve2;         // expected-warning {{expression result unused}}
index 1b444c16cd231b5a5a20387997b9af9e609a31f4..8d34a9ee7df999db55a9f1b451cf235d63983f3b 100644 (file)
@@ -12,7 +12,7 @@ void f() {
   __typeof(int)(a,5)<<a; // expected-error {{function-style cast to a builtin type can only take one argument}}
   void(a), ++a; // expected-warning {{expression result unused}}
   if (int(a)+1) {}
-  for (int(a)+1;;) {}
+  for (int(a)+1;;) {} // expected-warning {{expression result unused}}
   a = sizeof(int()+1);
   a = sizeof(int(1));
   typeof(int()+1) a2; // expected-error {{extension used}}