Date
2022-09-25.18:08:42
Message id
4261

Content

According to 6.3 [basic.def.odr] paragraph 3,

A function whose name appears as a potentially-evaluated expression is odr-used if it is the unique lookup result or the selected member of a set of overloaded functions (6.5 [basic.lookup], 12.2 [over.match], 12.3 [over.over]), unless it is a pure virtual function and its name is not explicitly qualified.

In the following example, consequently, S::f is odr-used but not defined, and (because it is an undefined odr-used inline function) a diagnostic is required:

  namespace {
    struct S {
      inline virtual void f() = 0;
    };
   void (S::*p) = &S::f;
  }

However, S::f cannot be called through such a pointer-to-member, so forming a pointer-to-member should not cause a pure virtual function to be odr-used. There is implementation divergence on this point.