------- Comment #10 from mmitchel at gcc dot gnu dot org  2006-09-10 22:04 
-------
I am not convinced that the code in Comment #8 is valid.

Although the operand of sizeof is not in fact evaluated, it seems odd to permit
an operand which cannot, even in principle, be evaluated.  This is not even a
case in which evaluating the operand would lead to undefined behavior; there is
simply no way to evaluate the operand at all.  If there is an implicit
conversion from B* to Z* at this point, then we must know how to performn the
conversion, but we cannot, since B is not complete.

Are you arguing that in:

  struct B {};
  struct D : public B {                                      
    static const int i = sizeof((B*)(D*)0);                  
  };

the conversion from D* to B* is a static_cast?

Has anyone asked about this case on the core reflector?


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING


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

Reply via email to