Created on 2009-09-23.00:00:00 last changed 178 months ago
[Voted into WP at March, 2010 meeting as document N3063.]
Proposed resolution (November, 2009):
Add the following paragraph at the end of 9.3.3 [dcl.ambig.res]:
Two consecutive left square bracket tokens shall appear only when introducing an attribute-specifier. [Note: If two consecutive left square brackets appear where an attribute-specifier is not allowed, the program is ill-formed even if the brackets match an alternative grammar production. —end note] [Example:
int p[10]; void f() { int x = 42; int(p[[x]{return x;}()]); // Error: malformed attribute on a nested // declarator-id and not a function-style cast of // an element of p. new int[[]{return x;}()]; // Error even though attributes are not allowed } // in this context.—end example]
The [[ ... ]] notation for attributes was thought to be completely unambiguous. However, it turns out that two [ characters can be adjacent and not be an attribute-introducer: the first could be the beginning of an array bound or subscript operator and the second could be the beginning of a lambda-introducer. This needs to be explored and addressed.
(See also issue 951.)
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | messages: + msg2698 |
2010-03-29 00:00:00 | admin | set | status: review -> cd2 |
2010-02-16 00:00:00 | admin | set | messages: + msg2540 |
2010-02-16 00:00:00 | admin | set | status: drafting -> review |
2009-11-08 00:00:00 | admin | set | status: open -> drafting |
2009-09-23 00:00:00 | admin | create |