Created on 2010-11-08.00:00:00 last changed 17 months ago
CWG 2023-06-13
Addressed by paper P2915R0.
CWG 2023-05-12
Both 8.9 [stmt.ambig] and 9.3.3 [dcl.ambig.res] need to be adjusted.
Notes from the March, 2011 meeting:
CWG agreed that the presence of auto should be considered in disambiguation, even though it is formally handled semantically rather than syntactically.
Because the restriction that a trailing-return-type can appear only in a declaration with “the single type-specifier auto” (9.3.4.6 [dcl.fct] paragraph 2) is a semantic, not a syntactic, restriction, it does not influence disambiguation, which is “purely syntactic” (8.9 [stmt.ambig] paragraph 3). Consequently, some previously unambiguous expressions are now ambiguous. For example:
struct A { A(int *); A *operator()(void); int B; }; int *p; typedef struct BB { int C[2]; } *B, C; void foo() { // The following line becomes invalid under C++0x: A (p)()->B; // ill-formed function declaration // In the following, // - B()->C is either type-id or class member access expression // - B()->C[1] is either type-id or subscripting expression // N3126 subclause 8.2 [dcl.ambig.res] does not mention an ambiguity // with these forms of expression A a(B ()->C); // function declaration or object declaration sizeof(B ()->C[1]); // sizeof(type-id) or sizeof on an expression }
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-06-13 16:05:19 | admin | set | messages: + msg7313 |
2023-05-13 11:43:16 | admin | set | messages: + msg7285 |
2011-04-10 00:00:00 | admin | set | messages: + msg3274 |
2011-04-10 00:00:00 | admin | set | status: open -> drafting |
2010-11-08 00:00:00 | admin | create |