C++ patch for typedef destructors

Bo Thorsen bo@suse.de
Tue Jan 30 23:26:00 GMT 2001


On 30 Jan 2001, Jason Merrill wrote:

> Actually, this isn't quite ready to go in.  Consider the following testcase:
> 
>   struct A {
>     static int U;
>   };
> 
>   typedef A U;
> 
>   int main ()
>   {
>     U::U = 42;
>   }
> 
> This should work.  Your patch should only apply to lookup after ::~.
> Also, you need to use same_type_p to compare types.

The testcase is wrong. You need to implement the static member outside the
class definition. Wether or not this actually does anything about what
it's testing, I can't say.

----
struct A {
  static int U;
};

int A:U;
----

Bo.

-- 

     Bo Thorsen                 |   Lahnsgade 31, st.
     Free software developer    |   5000 Odense C
     SuSE Labs                  |   Denmark



More information about the Gcc-patches mailing list