http://llvm.org/bugs/show_bug.cgi?id=19751

            Bug ID: 19751
           Summary: rejects-valid if parenthesized temporary is
                    incremented, due to incorrect disambiguation
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Clang incorrectly rejects this:

  struct X { void operator++(int); };
  void f() { (X())++; }

... because it believes the (X()) is a cast. I think this *only* goes wrong for
++ and --, where we need more than one token of lookahead past the
parenthesized type/expression.

When ParseCastExpression is called from the disambiguation code, it should call
the inner ParseCastExpression in the same disambiguation mode, and put its
token back if that call finds a non-cast-expression.

Amusingly, EDG and GCC have the same bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to