- Title
- Address of pure virtual function vs odr-use
- Status
- cd4
- Section
- 6.3 [basic.def.odr]
- Submitter
- Richard Smith
Created on 2013-01-31.00:00:00 last changed 116 months ago
Messages
Date: 2014-11-15.00:00:00
[Moved to DR at the November, 2014 meeting.]
Date: 2013-04-15.00:00:00
Proposed resolution (April, 2013): Change 6.3 [basic.def.odr] paragraph 3 as follows:
...A virtual member function is odr-used if it is not pure. 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
either its name is not explicitly qualified or the
expression forms a pointer to member (5.3.1). [Note:...
Date: 2026-07-27.15:54:01
According to 6.3 [basic.def.odr] paragraph 3, 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: 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.
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.
namespace {
struct S {
inline virtual void f() = 0;
};
void (S::*p) = &S::f;
}
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
| 2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
| 2015-04-13 00:00:00 | admin | set | messages: + msg5327 |
| 2014-11-24 00:00:00 | admin | set | status: ready -> dr |
| 2014-03-03 00:00:00 | admin | set | status: review -> ready |
| 2013-05-03 00:00:00 | admin | set | messages: + msg4316 |
| 2013-05-03 00:00:00 | admin | set | status: open -> review |
| 2013-01-31 00:00:00 | admin | create | |