This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-11-11
[Moved to DR at the September, 2013 meeting.]
The term “non-template function” is used in various places but never defined.
Proposed resolution (June, 2013):
Change 7.6.1.3 [expr.call] paragraph 1 as follows:
There are two kinds of function call: ordinary function call and member function [Footnote: A static member function (11.4.9 [class.static]) is an ordinary function. —end foot note] (11.4.2 [class.mfct]) call.A function call is a postfix expression followed by parentheses containing a possibly empty, comma-separated list of initializer-clauses which constitute the arguments to the function. The postfix expression shall have function type or pointer to function type. Foran ordinary functiona call to a non-member function or to a static member function, the postfix expression shall be either... For amember functioncall to a non-static member function, the postfix expression shall be...
Add a new paragraph before 9.3.4.6 [dcl.fct] paragraph 13:
A non-template function is a function that is not a function template specialization. [Note: A function template is not a function. —end note]
A declarator-id or abstract-declarator containing an ellipsis shall only be used...
Change the footnote in 12.2.2 [over.match.funcs] paragraph 7 as follows:
The process of argument deduction fully determines the parameter types of the function template specializations, i.e., the parameters of function template specializations contain no template parameter types. Thereforethe, except where specified otherwise, function template specializationscan be treated as normal (non-template) functionsand non-template functions (9.3.4.6 [dcl.fct]) are treated equivalently for the remainder of overload resolution.
Change the final sub-bullet of 12.2.2.3 [over.match.oper] paragraph 3 as follows:
For a unary operator @...
...
For the operator ,, the unary operator &, or the operator ->, the built-in candidates set...
...
do not have the same parameter-type-list as any
non-templatenon-member candidate that is not a function template specialization.
Change the indicated bullet of the second bulleted list of 12.2.4 [over.match.best] paragraph 1 as follows:
...
F1 is not a non-template
function template specialization and F2 is a function
template specialization, or, if not that,
...
Change 12.3 [over.over] paragraph 4 as follows:
If more than one function is selected, any function template specializations in the set are eliminated if the set also contains anon-templatefunction that is not a function template specialization, and any given function template specialization F1 is eliminated
Change Clause 13 [temp] paragraph 5 as follows:
A class template shall not have the same name as any other template, class, function, variable, enumeration, enumerator, namespace, or type in the same scope (6.4 [basic.scope]), except as specified in (13.7.6 [temp.spec.partial]). Except that a function template can be overloaded either by(non-template)functions (9.3.4.6 [dcl.fct]) with the same name or by other function templates with the same name (13.10.4 [temp.over]), a template name declared in namespace scope or in class scope shall be unique in that scope.
Change 13.7.3 [temp.mem] paragraph 2 as follows:
A local class of non-closure type shall not have member templates. Access control rules (11.8 [class.access]) apply to member template names. A destructor shall not be a member template. A
normal (non-template)member function (9.3.4.6 [dcl.fct]) with a given name and type and a member function template of the same name, which could be used to generate a specialization of the same type, can both be declared in a class. When both exist, a use of that name and type refers to the non-template member unless an explicit template argument list is supplied. [Example:template <class T> struct A { void f(int); template <class T2> void f(T2); }; template <> void A<int>::f(int) { } // non-template member function template <> template <> void A<int>::f<>(int) { } //templatemember function template specialization int main() { A<char> ac; ac.f(1); // non-template ac.f('c'); // template ac.f<>(1); // template }—end example]
Change 13.7.5 [temp.friend] paragraph 1 as follows:
A friend of a class or class template can be a function template or class template, a specialization of a function template or class template, or
an ordinary (a non-template)function or class. For a friend function declaration that is not a template declaration:
if the name of the friend is a qualified or unqualified template-id, the friend declaration refers to a specialization of a function template, otherwise,
if the name of the friend is a qualified-id and a matching non-template function is found in the specified class or namespace, the friend declaration refers to that function, otherwise,
if the name of the friend is a qualified-id and a matching function template is found in the specified class or namespace, the friend declaration refers to the deduced specialization of that function template (13.10.3.7 [temp.deduct.decl]), otherwise,
the name shall be an unqualified-id that declares (or redeclares)
an ordinary (a non-template)function.
Change 13.7.5 [temp.friend] paragraph 4 as follows:
When a function is defined in a friend function declaration in a class template, the function is instantiated when the function is odr-used (6.3 [basic.def.odr]). The same restrictions...
Change 13.7.7 [temp.fct] paragraph 2 as follows:
A function template can be overloaded with other function templates and withnormal (non-template)functions (9.3.4.6 [dcl.fct]). Anormalnon-template function is not related to a function template (i.e., it is never considered to be a specialization), even if it has the same name and type as a potentially generated function template specialization.144
Change 13.10.2 [temp.arg.explicit] paragraph 4 as follows:
[Note: An empty template argument list can be used to indicate that a given use refers to a specialization of a function template even when anormal (i.e.,non-template)function (9.3.4.6 [dcl.fct]) is visible that would otherwise be used. For example:...