Title
Interaction of inline namespaces and using-declarations
Status
cd2
Section
9.3.4 [dcl.meaning]
Submitter
Michael Wong

Created on 2009-06-19.00:00:00 last changed 170 months ago

Messages

Date: 2010-03-15.00:00:00

[Voted into WP at March, 2010 meeting as part of document N3079.]

Date: 2009-07-15.00:00:00

Proposed resolution (July, 2009):

Change 9.3.4 [dcl.meaning] paragraph 1 as follows:

...When the declarator-id is qualified, the declaration shall refer to a previously declared member of the class or namespace to which the qualifier refers (or, in the case of a namespace, of an element of the inline namespace within that scope set of that namespace (9.8.2 [namespace.def])), and; the member shall not merely have been introduced by a using-declaration in the scope of the class or namespace nominated by the nested-name-specifier of the declarator-id. [Note:...

(Note: this resolution depends on the resolution of issue 861.)

Date: 2009-06-19.00:00:00

According to 9.3.4 [dcl.meaning] paragraph 1,

When the declarator-id is qualified, the declaration shall refer to a previously declared member of the class or namespace to which the qualifier refers (or of an inline namespace within that scope (9.8.2 [namespace.def])), and the member shall not have been introduced by a using-declaration in the scope of the class or namespace nominated by the nested-name-specifier of the declarator-id.

This would appear to make the following example ill-formed, even though it would be well-formed if the using-declaration were omitted:

    namespace A {
      inline namespace B {
        template <class T> void foo() { }
     }
     using B::foo;
    }
    template void A::foo<int>();

This seems strange.

History
Date User Action Args
2010-03-29 00:00:00adminsetmessages: + msg2703
2010-03-29 00:00:00adminsetstatus: tentatively ready -> cd2
2010-02-16 00:00:00adminsetstatus: drafting -> tentatively ready
2009-11-08 00:00:00adminsetstatus: ready -> drafting
2009-08-03 00:00:00adminsetmessages: + msg2160
2009-08-03 00:00:00adminsetstatus: open -> ready
2009-06-19 00:00:00admincreate