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

--- Comment #8 from Daniel Krügler <daniel.kruegler at googlemail dot com> 
2012-11-01 07:11:56 UTC ---
(In reply to comment #7)
The error is real. The original example belongs to 5.2.8 p2:

"When typeid is applied to a **glvalue expression** whose type is a polymorphic
class type [..] "

which is the rule requiring dynamic evaluation of the expression. Your counter
example is an expression that is an rvalue expression, which belongs to p3:

"When typeid is applied to an expression other than a glvalue of a polymorphic
class type, the result refers to a std::type_info object representing the
static type of the expression. [..] The expression is an unevaluated operand
(Clause 5)."

Reply via email to