diff options
Diffstat (limited to 'clang/test/Parser/cxx-ambig-paren-expr.cpp')
-rw-r--r-- | clang/test/Parser/cxx-ambig-paren-expr.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/test/Parser/cxx-ambig-paren-expr.cpp b/clang/test/Parser/cxx-ambig-paren-expr.cpp index 39882056723..1535b009725 100644 --- a/clang/test/Parser/cxx-ambig-paren-expr.cpp +++ b/clang/test/Parser/cxx-ambig-paren-expr.cpp @@ -21,8 +21,13 @@ void f() { struct S{int operator()();}; (S())(); - // FIXME: Special case: "++" is postfix here, not prefix - // (S())++; + // Special case: "++" is postfix here, not prefix + (S())++; // expected-error {{cannot increment value of type 'S'}} + + struct X { int &operator++(int); X operator[](int); int &operator++(); }; + int &postfix_incr = (X()[3])++; + (X())++ ++; // ok, not a C-style cast + (X())++ ++X(); // expected-error {{C-style cast from 'int' to 'X ()'}} } // Make sure we do tentative parsing correctly in conditions. |