You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A nodeclspec-function-declaration shall declare a constructor, destructor, or conversion function. [Footnote: The “implicit int” rule of C is no longer supported.] [Note: A nodeclspec-function-declaration can only be used in a template-declaration (Clause 12), explicit-instantiation (12.8.2), or explicit-specialization (12.8.3). — end note]
This is wrong in two ways.
The footnote is wrong: the "implicit int" rule in C never permitted declarations without any specifiers-and-qualifiers, so implicit int has nothing to do with nodeclspec-function-declarations.
The note is wrong: a nodeclspec-function-declaration can't be used in a template-declaration. An out-of-line declaration of a member function must be either a definition, a friend, an explicit instantiation, or an explicit specialization, and a non-defining template-declaration is none of those things. (See [class.mfct]p1, which would incidentally benefit from saying something about the friend and explicit instantiation cases, though the friend case is at least mentioned by p6.)
The text was updated successfully, but these errors were encountered:
[dcl.type] p3 already has a footnote talking about the "implicit int rule". Let's remove the footnote.
@zygoloid, I don't understand the point on the note. I believe there are template-declaration s where we can, in fact, use a nodeclspec-function-declaration (admittedly, those are definitions, but declaration is not limited to non-defining declarations, I believe). And the note is correct in saying that a nodeclspec-function-declaration cannot appear outside of the listed contexts, although it is true that not all listed contexts will allow a nodeclspec-function-declaration in all cases. But I don't read the text of the note as attempting to say the latter.
recurses through member-declaration / template-declaration / declaration / nodeclspec-function-declaration and that's where the note applies. [temp] p2 says the declaration must declare a function, which it does, if [dcl.fct] is ever supposed to be applicable to constructors ("returning T"?)
[dcl.dcl]p12 says:
This is wrong in two ways.
The text was updated successfully, but these errors were encountered: