diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-09-09 20:38:47 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-09-09 20:38:47 +0000 |
commit | 2b4072fe5544c8c07a69b216424845d83efc2938 (patch) | |
tree | 91d84956f6d4488b961f861d448b9f1ef65889ea /clang/test/Parser/cxx-condition.cpp | |
parent | 53b728c27c76f3b97139ebfd8dc8d219c275b4fc (diff) | |
download | bcm5719-llvm-2b4072fe5544c8c07a69b216424845d83efc2938.tar.gz bcm5719-llvm-2b4072fe5544c8c07a69b216424845d83efc2938.zip |
Implement parser support for the 'condition' part of C++ selection-statements and iteration-statements (if/switch/while/for).
Add new 'ActOnCXXConditionDeclarationExpr' action, called when the 'condition' is a declaration instead of an expression.
llvm-svn: 56007
Diffstat (limited to 'clang/test/Parser/cxx-condition.cpp')
-rw-r--r-- | clang/test/Parser/cxx-condition.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-condition.cpp b/clang/test/Parser/cxx-condition.cpp new file mode 100644 index 00000000000..ccb77671731 --- /dev/null +++ b/clang/test/Parser/cxx-condition.cpp @@ -0,0 +1,11 @@ +// RUN: clang -parse-noop %s -verify
+
+void f() {
+ int a;
+ while (a) ;
+ while (int x) ; // expected-error {{expected '=' after declarator}}
+ while (float x = 0) ;
+ if (const int x = a) ;
+ switch (int x = a+10) {}
+ for (; int x = ++a; ) ;
+}
|