C++ patch for typedef destructors
Richard Sandiford
rsandifo@cygnus.com
Mon Jan 22 09:24:00 GMT 2001
> > This patch and testcase are an attempt to add support for constructs like
> > "p.T::U::~U()", where T::U is a typedef. At the moment, g++ tries to
> > look up ~U in the type that T::U is equivalent to, so the name U is lost.
>
> I believe that, in case this gets installed, we also want a testcase for
> the regression suite.
OK. Here's the testcase.
Richard
2001-01-22 Richard Sandiford <r.sandiford@redhat.com>
* testsuite/g++.dg/typedef-1.C: New testcase.
*** /dev/null Thu Aug 24 10:00:32 2000
--- ./gcc/testsuite/g++.dg/typedef-1.C Mon Jan 22 17:02:33 2001
***************
*** 0 ****
--- 1,13 ----
+
+ // { dg-do compile }
+ // Destructors for nested typedefs can be called explicitly.
+ // See 5.4.2
+
+ struct T { typedef int U; };
+ T::U p;
+ void f()
+ {
+ int U;
+ p.T::U::~U();
+ }
+
More information about the Gcc-patches
mailing list