]> granicus.if.org Git - clang/commitdiff
In the 'condition.cpp' test case, make sure that condition declarations are local...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 10 Sep 2008 23:34:50 +0000 (23:34 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 10 Sep 2008 23:34:50 +0000 (23:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56077 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/condition.cpp

index e535a00f41da109f4a520ff781a65effe3699d65..59cc61ca9a4962b19ecbc0cb237405d27bf8cccc 100644 (file)
@@ -1,8 +1,8 @@
 // RUN: clang -fsyntax-only -verify %s 
 
 void test() {
-  int a;
-  if (a) ++a;
+  int x;
+  if (x) ++x;
   if (int x=0) ++x;
 
   typedef int arr[10];
@@ -10,7 +10,7 @@ void test() {
   while (int f()=0) ; // expected-error: {{a function type is not allowed here}}
 
   struct S {} s;
-  if (s) ++a; // expected-error: {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
+  if (s) ++x; // expected-error: {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
   while (struct S x=s) ; // expected-error: {{expression must have bool type (or be convertible to bool) ('struct S' invalid)}}
   switch (s) {} // expected-error: {{statement requires expression of integer type ('struct S' invalid)}}