Title
Problems with :: as nested-name-specifier
Status
cd4
Section
9.9 [namespace.udecl]
Submitter
Jeff Snyder

Created on 2014-03-04.00:00:00 last changed 95 months ago

Messages

Date: 2014-11-15.00:00:00

[Moved to DR at the November, 2014 meeting.]

Date: 2014-10-15.00:00:00

Proposed resolution (October, 2014):

  1. Change the grammar in 9.9 [namespace.udecl] paragraph 1 as follows:

    • using-declaration:
        using typenameopt nested-name-spaceifier unqualified-id ;
        using :: unqualified-id ;
  2. Change 6.5.5.3 [namespace.qual] paragraph 1 as follows:

  3. If the nested-name-specifier of a qualified-id nominates a namespace (including the case where the nested-name-specifier is ::, i.e., nominating the global namespace), the name specified after the nested-name-specifier is looked up in the scope of the namespace. If a qualified-id starts with ::, the name after the :: is looked up in the global namespace. In either case, the The names in a template-argument of a template-id are looked up in the context in which the entire postfix-expression occurs.
  4. Change _N4567_.5.1.1 [expr.prim.general] paragraph 10 as follows:

  5. A ::, or a The nested-name-specifier :: names the global namespace. A nested-name-specifier that names a namespace (9.8 [basic.namespace]), in either case followed by the name of a member of that namespace (or the name of a member of a namespace made visible by a using-directive), is a qualified-id; 6.5.5.3 [namespace.qual] describes name lookup for namespace members that appear in qualified-ids. The result is...
  6. Change 9.9 [namespace.udecl] paragraph 9 as follows:

  7. Members declared by a using-declaration can be referred to by explicit qualification just like other member names (6.5.5.3 [namespace.qual]). In a using-declaration, a prefix :: refers to the global namespace. [Example:
Date: 2014-03-04.00:00:00

Issue 1411 added :: as a production for nested-name-specifier. However, the grammar for using-declarations should have been updated but was overlooked:

    using-declaration:
      using typenameopt nested-name-specifier unqualified-id ;
      using :: unqualified-id ;

In addition, there is some verbiage in 6.5.5.3 [namespace.qual] paragraph 1 and 9.9 [namespace.udecl] paragraph 9 that should probably be revised.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: + msg5371
2014-11-24 00:00:00adminsetstatus: tentatively ready -> dr
2014-10-13 00:00:00adminsetmessages: + msg5138
2014-10-13 00:00:00adminsetstatus: drafting -> tentatively ready
2014-07-07 00:00:00adminsetstatus: open -> drafting
2014-03-04 00:00:00admincreate