Created on 2010-08-07.00:00:00 last changed 142 months ago
[Voted into the WP at the March, 2011 meeting as part of paper N3262.]
Proposed resolution (November, 2010) [SUPERSEDED]:
Change 6.3 [basic.def.odr] paragraph 2 as follows:
...A variableor non-overloaded functionwhose name appears as a potentially-evaluated expression is odr-used unless it is an object that satisfies the requirements for appearing in a constant expression (7.7 [expr.const]) and the lvalue-to-rvalue conversion (7.3.2 [conv.lval]) is immediately applied... A virtual member function is odr-used if it is not pure. A non-overloaded function whose name appears as a potentially-evaluated expression or a member of a set of candidate functionsis odr-usedifit isselected by overload resolution when referred to from a potentially-evaluated expression, are odr-used, unless the function is pure and its name is not explicitly qualified. [Note:...
According to 6.3 [basic.def.odr] paragraph 2,
A variable or non-overloaded function whose name appears as a potentially-evaluated expression is used... A virtual member function is used if it is not pure.
However, that does not adequately address when a pure virtual function is used or not used. For example,
struct S {
virtual void pure1() = 0;
virtual void pure2() = 0;
};
void f(S* p) {
p->pure1();
p->S::pure2();
};
Both pure1 and pure2 satisfy the criterion that their name appears in a potentially-evaluated expression, but pure1 should not be considered “used” (which would require that it be defined); pure2 is “used” and must be defined.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
| 2011-04-10 00:00:00 | admin | set | messages: + msg3289 |
| 2011-04-10 00:00:00 | admin | set | status: review -> fdis |
| 2010-11-29 00:00:00 | admin | set | messages: + msg3068 |
| 2010-11-29 00:00:00 | admin | set | status: open -> review |
| 2010-08-07 00:00:00 | admin | create | |