((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
{
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
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
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)
{
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