This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


2007. Argument-dependent lookup for operator=

Section: 12.2.2.3  [over.match.oper]     Status: CD6     Submitter: Richard Smith     Date: 2014-09-23

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

Consider an example like:

  template<typename T> struct A { typename T::error e; };
  template<typename T> struct B { };
  B<A<void>> b1, &b2 = (b1 = b1);

If the assignment operator performs argument-dependent lookup, A<void> will be an associated class and will be instantiated, producing an error. Similar questions apply to the other member-only overloaded operators, operator-> and operator[]. Bullet 3.2 of 12.2.2.3 [over.match.oper] should be changed not to perform unqualified lookup for these operators.