summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-ambig-paren-expr.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-05-25 19:41:42 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-05-25 19:41:42 +0000
commitcf7530ff43e5025912f351a2b68e5298558a6d95 (patch)
tree18a0e6e07361fa8b7fae2952b5807e83e175736d /clang/test/Parser/cxx-ambig-paren-expr.cpp
parent23464b8f14d4a84fa419423362de2e95e49460b9 (diff)
downloadbcm5719-llvm-cf7530ff43e5025912f351a2b68e5298558a6d95.tar.gz
bcm5719-llvm-cf7530ff43e5025912f351a2b68e5298558a6d95.zip
PR4122: Tweak the ambiguity handling to handle (S())() correctly. I've
left out handling for stuff like (S())++ for the moment. llvm-svn: 72394
Diffstat (limited to 'clang/test/Parser/cxx-ambig-paren-expr.cpp')
-rw-r--r--clang/test/Parser/cxx-ambig-paren-expr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-ambig-paren-expr.cpp b/clang/test/Parser/cxx-ambig-paren-expr.cpp
index 00695612562..6f23b35d3e6 100644
--- a/clang/test/Parser/cxx-ambig-paren-expr.cpp
+++ b/clang/test/Parser/cxx-ambig-paren-expr.cpp
@@ -16,4 +16,11 @@ void f() {
typedef int *PT;
// Make sure stuff inside the parens are parsed only once (only one warning).
x = (PT()[(int){1}]); // expected-warning {{compound literals}}
+
+ // Special case: empty parens is a call, not an expression
+ struct S{int operator()();};
+ (S())();
+
+ // FIXME: Special case: "++" is postfix here, not prefix
+ // (S())++;
}
OpenPOWER on IntegriCloud