This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: skip_evaluation


On Wed, Jun 10, 2009 at 10:51 AM, Paolo Bonzini<paolo.bonzini@gmail.com> wrote:
>
>>> ? struct B {};
>>> ? struct D : public B {
>>> ? ? ? static const int i = sizeof((B*)(D*)0);
>>> ? };
>>>
>>> ? struct Z {};
>>> ? struct A : Z {};
>>> ? Z* implicitToZ (Z*);
>>> ? struct B : A {
>>> ? ? ? static const 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?
>
> build_cp_class does not give errors after it tests skip_evaluation. ?The
> constant-expression errors are given in the parsers.

which arguably is not  a good  place to issue such errors.  Support
for constexpr implies that we refrain from issuing such semantics
error from the parser.  However, constexpr patches will come somewhere in
July, so Ian probably does not want to wait for that now.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]