Movatterモバイル変換


[0]ホーム

URL:


Issue 565 - WG21 CWG Issues
Title
Conflict rules for using-declarations naming function templates
Status
cd3
Section
9.10 [namespace.udecl]
Submitter
Paolo Carlini

Created on2006-03-09.00:00:00 last changed145 months ago

Messages

msg3806 (view)
Date: 2012-02-15.00:00:00

[Voted into the WP at the February, 2012 meeting;moved to DR at the October, 2012 meeting.]

msg3458 (view)
Date: 2011-08-15.00:00:00

Proposed resolution (August, 2011):

Change 9.10 [namespace.udecl] paragraph 14 as follows:

If a function declaration in namespace scope or block scope has thesame name and the sameparameter typesparameter-type-list (9.3.4.6 [dcl.fct]) as afunction introduced by ausing-declaration, and thedeclarations do not declare the same function, the program isill-formed.If a function template declaration in namespacescope has the same name, parameter-type-list, return type, andtemplate parameter list as a function template introduced by ausing-declaration, the program is ill-formed.[Note: Twousing-declarations may introduce functionswith the same name and the sameparameter typesparameter-type-list. If, for a call to an unqualifiedfunction name, function overload resolution selects the functionsintroduced by suchusing-declarations, the function call isill-formed. [Example:...
msg1350 (view)
Date: 2006-03-09.00:00:00

The Standard does not appear to specify what happens for code like thefollowing:

    namespace one {      template<typename T> void fun(T);    }    using one::fun;    template<typename T> void fun(T);

9.10 [namespace.udecl] paragraph 13 does not appear to applybecause it deals only with functions, not function templates:

If a function declaration in namespace scope or block scope has thesame name and the same parameter types as a function introduced by ausing-declaration, and the declarations do not declare the samefunction, the program is ill-formed.

John Spicer: For function templates I believe the ruleshould be that if they have the same function type (parameter typesand return type) and have identical template parameter lists, theprogram is ill-formed.

History
DateUserActionArgs
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2012-11-03 00:00:00adminsetstatus: dr -> drwp
2012-02-27 00:00:00adminsetmessages: +msg3806
2012-02-27 00:00:00adminsetstatus: ready -> dr
2011-09-06 00:00:00adminsetmessages: +msg3458
2011-09-06 00:00:00adminsetstatus: open -> ready
2006-03-09 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp