Full name of submitter: Brian Bi
Link to Mattermost thread: https://chat.isocpp.org/general/pl/45iiima6bpgfugwoiztjiyewfw
Issue description: All implementations accept:
template <typename U>
constexpr bool foo = U::b;
template <class T>
struct A {
A() requires(foo<A>) {}
static constexpr bool b = true;
};
A<int> a;
Assuming that this is the desired result, lookup for the qualified name U::b should be performed from the point of instantiation of the requires-clause.
Suggested resolution: Edit [basic.lookup.qual.general]/3, adding a bulleted list and including a drive-by fix:
Qualified name lookup in a class, namespace, or enumeration performs a search of the scope associated with it ([class.member.lookup]) except as specified below. Unless otherwise specified, a qualified name undergoes qualified name lookup in its lookup context from the point where it appears unless
- the lookup context
either is dependent and is not the current instantiation ([temp.dep.type]) , in which case the lookup is done from the point of instantiation ([temp.point]) or
- the lookup context is
not a class or class template a type that is neither a class nor enumeration, in which case unqualified lookup is performed.
If nothing is found by qualified lookup for a member-qualified name that is the terminal name ([expr.prim.id.unqual]) of a nested-name-specifier and is not dependent, it undergoes unqualified lookup.
Full name of submitter: Brian Bi
Link to Mattermost thread: https://chat.isocpp.org/general/pl/45iiima6bpgfugwoiztjiyewfw
Issue description: All implementations accept:
Assuming that this is the desired result, lookup for the qualified name
U::bshould be performed from the point of instantiation of the requires-clause.Suggested resolution: Edit [basic.lookup.qual.general]/3, adding a bulleted list and including a drive-by fix: