Closed
Description
In the following example, the operand of typeid
(an xvalue of a polymorphic class type) wasn't evaluated in C++98, but was made to evaluated since C++11 due to N3055.
#include <typeinfo>
#include <cstdio>
struct B {
virtual ~B() { std::puts("~B"); }
};
struct D : B {};
struct WrapB {
B b;
};
struct WrapD {
D d;
};
int main() {
typeid(true ? WrapB().b : WrapD().d);
}
Metadata
Metadata
Assignees
Labels
No labels