diff options
Diffstat (limited to 'test/Parser/cxx-ambig-paren-expr.cpp')
| -rw-r--r-- | test/Parser/cxx-ambig-paren-expr.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/Parser/cxx-ambig-paren-expr.cpp b/test/Parser/cxx-ambig-paren-expr.cpp index 398820567237..cc509f7b059f 100644 --- a/test/Parser/cxx-ambig-paren-expr.cpp +++ b/test/Parser/cxx-ambig-paren-expr.cpp @@ -21,8 +21,14 @@ 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 ()'}} + int q = (int)++(x); } // Make sure we do tentative parsing correctly in conditions. |
