https://issues.dlang.org/show_bug.cgi?id=10442

Kenji Hara <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |D2

--- Comment #3 from Kenji Hara <[email protected]> ---
(In reply to Rainer Schuetze from comment #0)
> The current default implementation for template RTInfo always sets the value
> 0x12345678, so this should work:
> 
> ////////////////
> module s;
> 
> struct S
> {
>       int x;
>       void* p;
> }
> 
> ///////////////
> module test;
> 
> import s;
> 
> struct T
> {
>       int x;
>       void* p;
> }
> 
> void main()
> {
>       assert(typeid(T).rtInfo == cast(void*)0x12345678); // ok
>       assert(typeid(S).rtInfo == cast(void*)0x12345678); // fails
> }
> 
> ////////////////
> but the second assertion triggers if compiled with
> 
> dmd test.d

I think the typeid(S) object should not be generated when s.d is not directly
compiled. IOW, `dmd test.d` should cause link failure.

I implemented the behavior in:
https://github.com/D-Programming-Language/dmd/pull/3958

--

Reply via email to