another compiler bug?

Aarti_pl aarti at interia.pl
Thu Jan 10 03:12:39 PST 2008


Aarti_pl pisze:
> torhu pisze:
>> Aarti_pl wrote:
>  > Try this:
>> A* cp = *(new A*);
> 
> I needed something like above. Unfortunately your solution doesn't work 
> (don't know why). I get access violation in my program when returning 
> '*(new A*)'.
> 
> I managed to overcome bug in DMD with below:
> 
> void func(T)() {
>     static TYPE res;
>     res = new T;
>         return &res;
> }
> 
> although it will cause memory leaks for every type for which the 
> function is instantiated. So I consider bug in DMD as quite serious...
> 

It can be of course also problem with logic in my program. I will check it.

BR
Marcin Kuszczak
(aarti_pl)


More information about the Digitalmars-d-learn mailing list