summaryrefslogtreecommitdiff
path: root/test/PCH/cxx2a-for-init-statement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/PCH/cxx2a-for-init-statement.cpp')
-rw-r--r--test/PCH/cxx2a-for-init-statement.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/PCH/cxx2a-for-init-statement.cpp b/test/PCH/cxx2a-for-init-statement.cpp
new file mode 100644
index 0000000000000..2147c0f8a2a17
--- /dev/null
+++ b/test/PCH/cxx2a-for-init-statement.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -emit-pch -std=c++2a -o %t %s
+// RUN: %clang_cc1 -std=c++2a -x ast -ast-print %t | FileCheck %s
+
+void f() {
+ // CHECK: for (int arr[3]; int n : arr) {
+ // CHECK-NEXT: }
+ for (int arr[3]; int n : arr) {}
+}