Created on2012-06-08.00:00:00 last changed136 months ago
[Moved to DR at the September, 2013 meeting.]
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 andmember function [Footnote: A static member function(11.4.9 [class.static]) is an ordinary function. —end footnote] (11.4.2 [class.mfct]) call.A function call is apostfix expression followed by parentheses containing a possibly empty,comma-separated list ofinitializer-clauses which constitute thearguments to the function.The postfix expression shall have functiontype or pointer to function type. Foran ordinaryfunctiona callto a non-member function or to astatic member function, the postfix expression shall be either... Foramember functioncallto a non-static memberfunction, the postfix expression shall be...
Add a new paragraph before 9.3.4.6 [dcl.fct] paragraph 13:
Anon-template function is a function that is not afunction template specialization. [Note: A function templateis not a function. —end note]
Adeclarator-id orabstract-declarator containing anellipsis shall only be used...
Change the footnote in 12.2.2 [over.match.funcs] paragraph 7as follows:
The process of argument deduction fully determines the parameter types ofthe function template specializations, i.e., the parameters of functiontemplate specializations contain no template parametertypes. Thereforethe, except where specifiedotherwise, function template specializationscan be treated asnormal (non-template) functionsand non-template functions(9.3.4.6 [dcl.fct]) are treated equivalently for theremainder of overload resolution.
Change the final sub-bullet of 12.2.2.3 [over.match.oper] paragraph 3as follows:
For a unary operator@...
...
For the operator,, the unary operator&, orthe operator->, the built-in candidates set...
...
do not have the same parameter-type-list asany
non-templatenon-member candidatethat is not afunction template specialization.
Change the indicated bullet of the second bulleted list of12.2.4 [over.match.best] paragraph 1 as follows:
...
F1 isnot anon-templatefunctiontemplate specialization andF2 is a functiontemplate specialization, or, if not that,
...
Change 12.3 [over.over] paragraph 4 as follows:
If more than one function is selected, any function templatespecializations in the set are eliminated if the set also contains anon-templatefunctionthat is not a function templatespecialization, and any given function templatespecializationF1 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 samescope (6.4 [basic.scope]), except as specified in(13.7.6 [temp.spec.partial]). Except that a function template can beoverloaded either by(non-template)functions(9.3.4.6 [dcl.fct]) with the same name or by otherfunction templates with the same name (13.10.4 [temp.over]), atemplate name declared in namespace scope or in class scope shall be uniquein that scope.
Change 13.7.3 [temp.mem] paragraph 2 as follows:
A local class of non-closure type shall not have membertemplates. Access control rules (11.8 [class.access]) apply tomember template names. A destructor shall not be a membertemplate. A
normal (non-template)memberfunction(9.3.4.6 [dcl.fct]) with a given name and typeand a member function template of the same name, which could be used togenerate a specialization of the same type, can both be declared in aclass. When both exist, a use of that name and type refers to thenon-template member unless an explicit template argument list issupplied. [Example:template <class T> struct A { void f(int); template <class T2> void f(T2); }; template <> void A<int>::f(int) { } // non-template memberfunction template <> template <> void A<int>::f<>(int) { } //templatememberfunction 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 orclass template, a specialization of a function template or class template,or
an ordinary (a non-template)functionor class. For a friend function declaration that is not a templatedeclaration:
if the name of the friend is a qualified orunqualifiedtemplate-id, the friend declaration refers to aspecialization of a function template, otherwise,
if the name of the friend is aqualified-id and a matchingnon-template function is found in the specified class or namespace, thefriend declaration refers to that function, otherwise,
if the name of the friend is aqualified-id and a matchingfunction template is found in the specified class or namespace, the frienddeclaration refers to the deduced specialization of that function template(13.10.3.7 [temp.deduct.decl]), otherwise,
the name shall be anunqualified-id that declares (orredeclares)
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 classtemplate, the function is instantiated when the function is odr-used(6.3 [basic.def.odr]). Thesame restrictions...
Change 13.7.7 [temp.fct] paragraph 2 as follows:
A function template can be overloaded with other function templates andwithnormal (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 thesame name and type as a potentially generated function templatespecialization.144
Change 13.10.2 [temp.arg.explicit] paragraph 4 as follows:
[Note: An empty template argument list can be used to indicate thata 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 wouldotherwise be used. For example:...
The term “non-template function” is used in variousplaces but never defined.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2014-11-24 00:00:00 | admin | set | status: drwp -> c++14 |
| 2014-03-03 00:00:00 | admin | set | status: dr -> drwp |
| 2013-10-14 00:00:00 | admin | set | messages: +msg4678 |
| 2013-10-14 00:00:00 | admin | set | status: tentatively ready -> dr |
| 2013-09-03 00:00:00 | admin | set | messages: +msg4452 |
| 2013-09-03 00:00:00 | admin | set | status: drafting -> tentatively ready |
| 2012-11-03 00:00:00 | admin | set | status: open -> drafting |
| 2012-06-08 00:00:00 | admin | create | |