Re: skip_evaluation

2009-06-10 Thread Gabriel Dos Reis
((B*)p); >>>   }; >>> >>> (see PR27177).  All of these would still be forbidden within (0?x:y). >> >> OK, but should they perhaps give an error which would perhaps not be >> given if skip_evaluation is true? > > build_cp_class does not give err

Re: skip_evaluation

2009-06-10 Thread Paolo Bonzini
{ static const int i = sizeof ((B*)p); }; (see PR27177). All of these would still be forbidden within (0?x:y). OK, but should they perhaps give an error which would perhaps not be given if skip_evaluation is true? build_cp_class does not give errors after it tests skip_evaluation

Re: skip_evaluation

2009-06-10 Thread Ian Lance Taylor
st int i = sizeof(implicitToZ((B*)0)); >}; > >struct B {}; >struct D; >D* p; >struct D: public B { >static const int i = sizeof ((B*)p); >}; > > (see PR27177). All of these would still be forbidden within (0?x:y). OK, but should they perhaps give an error which would perhaps not be given if skip_evaluation is true? Ian

Re: skip_evaluation

2009-06-10 Thread Paolo Bonzini
In asking this, I'm particularly puzzled by code like this in build_base_path in cp/class.c: /* Don't bother with the calculations inside sizeof; they'll ICE if the source type is incomplete and the pointer value doesn't matter. */ if (skip_evaluation) {

skip_evaluation

2009-06-09 Thread Ian Lance Taylor
I have a question for C++ language lawyers. The common part of the C/C++ frontends has a global variable named skip_evaluation. Both frontends set this variable while parsing an expression inside sizeof and friends. This has the effect of disabling various warnings which are irrelevant for code