This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25466] typeid expression fails to throw bad_typeid according to 5.2.8p2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25466

--- Comment #10 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-11-01 09:10:56 UTC ---
(In reply to comment #9)
I don't think that the standard says (or intends to say) that an implementation
has to defer all evaluations here. For example, assume you provide

polymorphic& operator+(polymorphic a, polymorphic b);

with some definition this is still UB when the expression

*(T*)0 + *(T*)0

occurs as operand of typeid (Note the arguments are by value). An
implementation is only required to detect whether an (immediate) runtime
glvalue of a polymorphic class as argument of typeid refers to an "empty
glvalue". Anything beyond that would fall under 

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#232

I think.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]