aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-ambig-paren-expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parser/cxx-ambig-paren-expr.cpp')
-rw-r--r--test/Parser/cxx-ambig-paren-expr.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Parser/cxx-ambig-paren-expr.cpp b/test/Parser/cxx-ambig-paren-expr.cpp
new file mode 100644
index 0000000000..c054164e75
--- /dev/null
+++ b/test/Parser/cxx-ambig-paren-expr.cpp
@@ -0,0 +1,15 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+void f() {
+ typedef int T;
+ int x, *px;
+
+ // Type id.
+ (T())x; // expected-error {{used type 'T (void)'}}
+ (T())+x; // expected-error {{used type 'T (void)'}}
+ (T())*px; // expected-error {{used type 'T (void)'}}
+
+ // Expression.
+ x = (T());
+ x = (T())/x;
+}