summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/condition.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-09-10 23:34:50 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-09-10 23:34:50 +0000
commit996677e12dfaae24d6d888c572424abd56566c02 (patch)
treea7bc937c997f644f254af91ec2fa44346ce0f003 /clang/test/SemaCXX/condition.cpp
parentc1ae01688f27f61edf1c449b7c67688275ac8fba (diff)
downloadbcm5719-llvm-996677e12dfaae24d6d888c572424abd56566c02.tar.gz
bcm5719-llvm-996677e12dfaae24d6d888c572424abd56566c02.zip
In the 'condition.cpp' test case, make sure that condition declarations are local to the statement.
llvm-svn: 56077
Diffstat (limited to 'clang/test/SemaCXX/condition.cpp')
-rw-r--r--clang/test/SemaCXX/condition.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/condition.cpp b/clang/test/SemaCXX/condition.cpp
index e535a00f41d..59cc61ca9a4 100644
--- a/clang/test/SemaCXX/condition.cpp
+++ b/clang/test/SemaCXX/condition.cpp
@@ -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)}}
OpenPOWER on IntegriCloud