Created on 2025-03-24.00:00:00 last changed 3 weeks ago
Suggested resolution:
Change the grammar before 9.10 [namespace.udecl] paragraph 1 as follows:
using-declarator: typenameopt nested-name-specifierunqualified-idusing-declarator-id using-declarator-id: identifier operator-function-id conversion-function-id literal-operator-id
Change in 9.10 [namespace.udecl] paragraph 1 as follows:
The component names of a using-declarator are those of its nested-name-specifier andunqualified-idusing-declarator-id. The component name of a using-declarator-id is itself. Each using-declarator in a using-declaration [ Footnote: ... ] names the set of declarations found by lookup (6.5.5 [basic.lookup.qual]) for the using-declarator, except that class and enumeration declarations that would be discarded are merely ignored when checking for ambiguity (6.5 [basic.lookup]), conversion function templates with a dependent return type are ignored, and certain functions are hidden as described below. If the terminal name of the using-declarator is dependent (13.8.3.2 [temp.dep.type]), the using-declarator is considered to name a constructor if and only if the using-declarator-id is an identifier and the nested-name-specifier has a terminal name that is the same as theunqualified-ididentifier. If the lookup in any instantiation finds that a using-declarator that is not considered to name a constructor does do so, or that a using-declarator that is considered to name a constructor does not, the program is ill-formed.
Change in 9.10 [namespace.udecl] paragraph 2 as follows:
If the using-declarator names a constructor, it declares that the class inherits the named set of constructor declarations from the nominated base class. Otherwise, the using-declarator introduces its using-declarator-id. [Note 1:Otherwise, the unqualified-id in the using-declarator is bound toDuring name lookup, the using-declarator, whichis replacedduring name lookupwith the declarations it names (6.5 [basic.lookup]). If such a declaration is of an enumeration, the names of its enumerators are not bound. For the keyword typename, see 13.8 [temp.res]. —end note]
Change in 9.10 [namespace.udecl] paragraph 4 as follows:
[Note 2: Since destructors do not have names, a using-declaration cannot refer to a destructor for a base class. —end note]If a constructor or assignment operator brought from a base class into a derived class ...
Remove 9.10 [namespace.udecl] paragraph 5:
A using-declaration shall not name a template-id.struct A { template <class T> void f(T); template <class T> struct X { }; }; struct B : A { using A::f<double>; // error using A::X<int>; // error };
(From submission #692.)
There is no normative rule that would cause a using-declarator not naming a constructor to bind its unqualified-id in the scope it inhabits.
Also, a normative prohibition for something like using X::~X; seems to be missing.
History | |||
---|---|---|---|
Date | User | Action | Args |
2025-05-11 06:57:50 | admin | set | messages: + msg8027 |
2025-03-24 00:00:00 | admin | create |