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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56007 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/cxx-condition.cpp b/test/Parser/cxx-condition.cpp
new file mode 100644
index 0000000..ccb7767
--- /dev/null
+++ b/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; ) ;
+}