Add a test case to make sure that an ambiguous paren expression is only parsed once.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72298 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/cxx-ambig-paren-expr.cpp b/test/Parser/cxx-ambig-paren-expr.cpp
index c054164..0069561 100644
--- a/test/Parser/cxx-ambig-paren-expr.cpp
+++ b/test/Parser/cxx-ambig-paren-expr.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %s
+// RUN: clang-cc -fsyntax-only -pedantic -verify %s
void f() {
typedef int T;
@@ -12,4 +12,8 @@
// Expression.
x = (T());
x = (T())/x;
+
+ typedef int *PT;
+ // Make sure stuff inside the parens are parsed only once (only one warning).
+ x = (PT()[(int){1}]); // expected-warning {{compound literals}}
}