This is the mail archive of the gcc-patches@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: [C++ PATCH] [PR2204] Check for parameters of abstract types -Take 3


You Wrote Mark Mitchell
> Giovanni Bajo wrote:
>
>> Exactly. If you look in the testcase of my patch, it checks for some
>> slightly
>> different situations which require delayed evaluation of abstract types.
>> The
>> testcase was carefully constructed thinking of different situations.
>>
>>>Presumably, we would already diagnose it if someone tried to call or
>>>define "f"?
>>
>>
>> Yes, we do that at the definition point. Calling f() is impossible: if
>> use *s
>> with a S*, we get an error because we cannot allocate the temporary.
>
> Yes, that's what I meant.
>
> Curiously, EDG diagnoses the example I gave, but not:

I think that is a bug in EDG in diagnosing your earlier example.
Your very example can be expanded in combining two translation
units:

   // 1.C
   struct S;
   void f(S);

   // 2.C
   struct S { virtual void g() = 0; };

   int main() { return 0; }

How do you diagnose the declaration in 1.C, if you follow Giovanni's
reading?


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