------- Comment #8 from rguenth at gcc dot gnu dot org  2010-08-07 16:25 -------
Which means that if the language guarantees that for

Base2* fooA(Derived* x)
{
    Base2& y = *x;
    return &y;
}

x being a null pointer invokes undefined behavior (because references can't
bind to nothing(?)) then the frontend should emit not

<<cleanup_point   struct Base2 & y = (struct Base2 &) (NON_LVALUE_EXPR <x> !=
0B ? &NON_LVALUE_EXPR <x>->D.1702 : 0B);>>;

but instead

<<cleanup_point   struct Base2 & y = (struct Base2 &) &NON_LVALUE_EXPR
<x>->D.1702;>>;

CCing Jason.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot org


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

Reply via email to