[LLVMbugs] [Bug 20349] New: rejects-valid if parenthesized temporary is followed by array indexing

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 17 17:14:21 PDT 2014


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

            Bug ID: 20349
           Summary: rejects-valid if parenthesized temporary is followed
                    by array indexing
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang rejects this valid code in C++11 onwards:

  struct S { S operator[](int); S operator()(); };
  int n;
  void f() { (S())[n](); }

The problem is that we commit to handling the '[' as the start of a
lambda-expression too early.

We also incorrectly reject the above testcase in Objective-C++ mode, because we
think the '[' is the start of a message send expression.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140718/dd76bcae/attachment.html>


More information about the llvm-bugs mailing list