This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25466] typeid expression fails to throw bad_typeid according to 5.2.8p2
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Nov 2012 09:10:56 +0000
- Subject: [Bug c++/25466] typeid expression fails to throw bad_typeid according to 5.2.8p2
- Auto-submitted: auto-generated
- References: <bug-25466-4@http.gcc.gnu.org/bugzilla/>
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.