Andrew Pinski wrote:
>> In any case, in practice, ARM's RealView compiler accepts:
>>
>> struct __declspec(notshared) S {
>> __declspec(dllimport) void f();
>> void g();
>> };
>>
>> void S::g() {
>> f();
>> }
>>
>> And, there's a large body of code that uses this.
>
> Because you missed typeinfo is also hidden (not just vtables).
That has nothing to do with the fact that there's a lot of existing code
out there depending on this.
> So in an user program you use typeid(S), you will get a link failure.
> If f and g are switch around, you will then not get a link failure but
> doing a "throw S();" with a catch on the outside, will cause the throw
> to be caught by a try{ .... } catch (S &a) ...
Sure. But, so what? If you try to access hidden variables from C,
things won't work then too.
You seem to be saying that because you can do things that don't work, we
should disallow a useful construct.
--
Mark Mitchell
CodeSourcery
[EMAIL PROTECTED]
(650) 331-3385 x713