Closed sdkrystian closed 5 months ago
CWG2846
@jensmaurer I'm not sure the proposed wording in the issue is quite correct. Consider the following:
struct A
{
template<typename T>
void f(this T);
};
template<>
void A::f(this int);
The explicit specialization of A::f
is neither a member-declarator
nor a function-definition
.
Now that I think about it, the declaration
of a template-declaration
or explicit-specialization
is never a member-declaration
... should I open another issue for this?
I've generalized the wording.
Full name of submitter: Krystian Stasiowski
Reference (section label): [dcl.fct]
Link to reflector thread (if any): N/A
Issue description:
According to [dcl.fct] p6:
In the following example:
The out-of-line definition of
A::f
is not a member-declarator, therefore it cannot contain an explicit-object-parameter-declaration. However, this is accepted by clang, GCC, EDG, and MSVC.Suggested resolution:
Replace the first subbullet of [dcl.fct] p6 with:
Change the final sentence of [dcl.fct] p6 as follows (note: this affects some of the wording touched by CWG2553: