Title
Restricted lookup in nested-name-specifier
Status
cd6
Section
6.5.5 [basic.lookup.qual]
Submitter
Canada

Created on 2013-09-24.00:00:00 last changed 27 months ago

Messages

Date: 2013-09-15.00:00:00

Notes from the September, 2013 meeting:

The restricted lookup mentioned in 6.5.5 [basic.lookup.qual] paragraph 1 is based on a one-token lookahead; because the next token following A in the example is not ::, the restricted lookup does not apply, and the result is ambiguous. Uncommenting the template keyword in the example does not affect the lookup.

Date: 2020-11-15.00:00:00

[Accepted at the November, 2020 meeting as part of paper P1787R6 and moved to DR at the February, 2021 meeting.]

N3690 comment CA 21

Consider the following example:

  template <typename T> struct B { };
  namespace N {
    namespace L {
      template <int> void A();
    }
    namespace M {
      template <int> struct A { typedef int y; };
    }
    using namespace L;
    using namespace M;
  }
  B<N::/*template */A<0>::y> (x);

Which A is referenced in the last line? According to 6.5.5 [basic.lookup.qual] paragraph 1,

If a :: scope resolution operator in a nested-name-specifier is not preceded by a decltype-specifier, lookup of the name preceding that :: considers only namespaces, types, and templates whose specializations are types.

It is not clear whether this applies to the example or not, and the interpretation of the < token depends on the result of the lookup.

History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: drwp -> cd6
2021-02-24 00:00:00adminsetstatus: accepted -> drwp
2020-12-15 00:00:00adminsetstatus: open -> accepted
2013-10-14 00:00:00adminsetmessages: + msg4634
2013-09-24 00:00:00admincreate