Created on2012-09-06.00:00:00 last changed136 months ago
[Moved to DR at the September, 2013 meeting.]
Proposed resolution (June, 2013):
Insert a new paragraph following 6.4.2 [basic.scope.pdecl] paragraph 3, as follows
...whichever comes first. The point of declaration of an alias or aliastemplate immediately follows thetype-id to which the alias refers.
The point of declaration of ausing-declaration that doesnot name a constructor is immediately after theusing-declaration(9.10 [namespace.udecl]).
The point of declaration for an enumerator...
Change 9.10 [namespace.udecl] paragraph 1 as follows:
...If ausing-declaration names a constructor(6.5.5.2 [class.qual]), it implicitly declares a set ofconstructors in the class in which theusing-declaration appears(_N4527_.12.9 [class.inhctor]); otherwise the name specified inausing-declaration is a synonym forthe name of some entitydeclared elsewherea set of declarations in another namespaceor class.
Change 9.10 [namespace.udecl] paragraph 11 as follows:
The entity declared by ausing-declaration shall be known inthe context using it according to its definition at the point oftheusing-declaration. DefinitionsMembers added tothe namespace after theusing-declaration are not considered when ause of the name is made.[Note: Thus, additional overloadsadded after theusing-declaration are ignored, but defaultfunction arguments (9.3.4.7 [dcl.fct.default]), default templatearguments (13.2 [temp.param]), and template specializations(13.7.6 [temp.spec.partial], 13.9.4 [temp.expl.spec]) areconsidered. —end note] [Example:
Additional note (October, 2012):
The note added by this resolution to 9.10 [namespace.udecl] paragraph 11regarding the treatment of default arguments directlycontradicts the normative statement of 9.3.4.7 [dcl.fct.default] paragraph 9:
When a declaration of a function is introduced by way of ausing-declaration (9.10 [namespace.udecl]), any defaultargument information associated with the declaration is made known aswell. If the function is redeclared thereafter in the namespace withadditional default arguments, the additional arguments are also knownat any point following the redeclaration where theusing-declaration is in scope.
The issue has been returned to "review" status for reconciliationof these two passages.
Proposed resolution (October, 2012) [superseded]:
Add the following as a new paragraph after 6.4.2 [basic.scope.pdecl] paragraph 3:
The point of declaration for a class or class template first declaredby aclass-specifier is immediately after the identifier orsimple-template-id (if any) in itsclass-head (Clause 11 [class]). The point of declaration for an enumerationis immediately after the identifier (if any) in either itsenum-specifier (9.8.1 [dcl.enum]) or its firstopaque-enum-declaration (9.8.1 [dcl.enum]), whichevercomes first. The point of declaration of an alias or alias templateimmediately follows thetype-id to which the alias refers.
The point of declaration of ausing-declaration thatdoes not name a constructor is immediately after theusing-declaration (9.10 [namespace.udecl]).
Change 9.10 [namespace.udecl] paragraph 1 as follows:
...If ausing-declaration names a constructor (6.5.5.2 [class.qual]), it implicitly declares a set of constructors in theclass in which theusing-declaration appears (_N4527_.12.9 [class.inhctor]); otherwise the name specified in ausing-declaration is a synonym forthe name of some entitydeclared elsewherea set of declarations in anothernamespace or class.
Change 9.10 [namespace.udecl] paragraph 11 as follows:
The entity declared by ausing-declaration shall be known inthe context using it according to its definition at the point of theusing-declaration. DefinitionsDeclarationsadded to the namespace after theusing-declaration are notconsidered when a use of the name is made.[Note: Thus,additional overloads and default arguments (9.3.4.7 [dcl.fct.default]) added after theusing-declaration are ignored,but template specializations (13.7.6 [temp.spec.partial],13.9.4 [temp.expl.spec]) are considered. —endnote] [Example:...
There are at least a couple of problems with the current wording of9.10 [namespace.udecl]. First is the use of the word “entity”to describe what theusing-declaration represents. For example,in paragraph 1,
If ausing-declaration names a constructor (6.5.5.2 [class.qual]), it implicitly declares a set of constructors in theclass in which theusing-declaration appears (_N4527_.12.9 [class.inhctor]); otherwise the name specified in ausing-declaration is a synonym for the name of some entitydeclared elsewhere.
An overload set of functions and function templates is not an“entity,” according to 6.1 [basic.pre] paragraph 3.A better phrasing might be something like, “...a synonym for aset of declarations in a different declarative region.”
The other problem is in paragraph 11:
The entity declared by ausing-declaration shall be known inthe context using it according to its definition at the point of theusing-declaration. Definitions added to the namespace after theusing-declaration are not considered when a use of the name ismade.
This has the same problem with use of the term “entity,”and it also refers to “definitions” when presumably itmeans “declarations.”
| 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: +msg4687 |
| 2013-10-14 00:00:00 | admin | set | status: tentatively ready -> dr |
| 2013-09-03 00:00:00 | admin | set | messages: +msg4458 |
| 2013-09-03 00:00:00 | admin | set | status: drafting -> tentatively ready |
| 2013-05-03 00:00:00 | admin | set | status: review -> drafting |
| 2012-11-03 00:00:00 | admin | set | messages: +msg4085 |
| 2012-11-03 00:00:00 | admin | set | messages: +msg4084 |
| 2012-11-03 00:00:00 | admin | set | status: open -> review |
| 2012-09-06 00:00:00 | admin | create | |