You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>structB {
virtual~B() { std::puts("~B"); }
};
structD : B {};
structWrapB {
B b;
};
structWrapD {
D d;
};
intmain() {
typeid(true ? WrapB().b : WrapD().d);
}
The text was updated successfully, but these errors were encountered:
frederick-vs-ja
changed the title
[diff.cpp03.expr] Should we list the behavioral change of typeid in C++11 due to N3055?
CWG2887 [diff.cpp03.expr] Should we list the behavioral change of typeid in C++11 due to N3055?
Apr 29, 2024
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.The text was updated successfully, but these errors were encountered: