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

2024-10-26


2078. Name lookup of mem-initilizer-id

Section: 6.5.2  [class.member.lookup]     Status: NAD     Submitter: Richard Smith     Date: 2015-01-31

The name lookup in a base-specifier and a mem-initializer differ in that the former ignores non-type names but the latter does not. When the mem-initializer-id is qualified, this can lead to surprising results:

  struct file_stat : ::stat {    // the class
    file_stat() : ::stat{} {}    // the function
  };

Rationale (May, 2015):

The use of a qualified-id as a mem-initializer-id is sufficiently unusual that it is not worth changing the lookup rules to accommodate it.