- Title
- Conflict rules for using-declarations naming function templates
- Status
- cd3
- Section
- 9.10 [namespace.udecl]
- Submitter
- Paolo Carlini
Created on 2006-03-09.00:00:00 last changed 151 months ago
Messages
Date: 2012-02-15.00:00:00
[Voted into the WP at the February, 2012 meeting;
moved to DR at the October, 2012 meeting.]
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 the
same name and the same
parameter types
parameter-type-list (9.3.4.6 [dcl.fct]) as a
function introduced by a using-declaration, and the
declarations do not declare the same function, the program is
ill-formed. If a function template declaration in namespace
scope has the same name, parameter-type-list, return type, and
template parameter list as a function template introduced by a
using-declaration, the program is ill-formed.
[Note: Two using-declarations may introduce functions
with the same name and the same parameter types
parameter-type-list. If, for a call to an unqualified
function name, function overload resolution selects the functions
introduced by such using-declarations, the function call is
ill-formed. [Example:...
Date: 2006-03-09.00:00:00
The Standard does not appear to specify what happens for code like the
following: 9.10 [namespace.udecl] paragraph 13 does not appear to apply
because it deals only with functions, not function templates:
John Spicer: For function templates I believe the rule
should be that if they have the same function type (parameter types
and return type) and have identical template parameter lists, the
program is ill-formed.
namespace one {
template<typename T> void fun(T);
}
using one::fun;
template<typename T> void fun(T);
If a function declaration in namespace scope or block scope has the
same name and the same parameter types as a function introduced by a
using-declaration, and the declarations do not declare the same
function, the program is ill-formed.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2014-03-03 00:00:00 | admin | set | status: drwp -> cd3 |
| 2012-11-03 00:00:00 | admin | set | status: dr -> drwp |
| 2012-02-27 00:00:00 | admin | set | messages: + msg3806 |
| 2012-02-27 00:00:00 | admin | set | status: ready -> dr |
| 2011-09-06 00:00:00 | admin | set | messages: + msg3458 |
| 2011-09-06 00:00:00 | admin | set | status: open -> ready |
| 2006-03-09 00:00:00 | admin | create | |