-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"cwg-issueAn issue that was filed to the Core Working GroupAn issue that was filed to the Core Working Groupobjective-c++rejects-valid
Description
| Bugzilla Link | 20349 |
| Version | unspecified |
| OS | Linux |
| CC | @DougGregor |
Extended Description
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.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"cwg-issueAn issue that was filed to the Core Working GroupAn issue that was filed to the Core Working Groupobjective-c++rejects-valid