Created on 2015-09-17.00:00:00 last changed 94 months ago
Proposed resolution (February, 2016):
Change 11.4.8.3 [class.conv.fct] paragraph 3 as follows:
The conversion-type-id shall not represent a function type nor an array type. The conversion-type-id in a conversion-function-id is the longest
possiblesequence ofconversion-declaratorstokens that could possibly form a conversion-type-id. [Note: This prevents ambiguities between the declarator operator * and its expression counterparts. [Example:&ac.operator int*i; // syntax error: // parsed as: &(ac.operator int *)i // not as: &(ac.operator int)*iThe * is the pointer declarator and not the multiplication operator. —end example] This rule also prevents ambiguities for attributes. [Example:
operator int [[noreturn]] (); // error: noreturn attribute applied to a type—end example] —end note]
[Adopted at the February, 2016 meeting.]
The declaration
operator int [[noreturn]] ();
is ambiguous with respect to the binding of the attribute. It could either be parsed (as apparently intended by the user) as part of the noptr-declarator (9.3 [dcl.decl] paragraph 4) or as part of the type-specifier-seq (9.2.9 [dcl.type] paragraph 1) of the conversion-type-id (11.4.8.3 [class.conv.fct] paragraph 1) . Current implementations disambiguate this declaration in favor of the latter interpretation, issuing an error for the declaration because the noreturn attribute cannot apply to a type.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: tentatively ready -> cd4 |
2016-02-15 00:00:00 | admin | set | messages: + msg5704 |
2016-02-15 00:00:00 | admin | set | status: drafting -> tentatively ready |
2015-09-17 00:00:00 | admin | create |