This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C++ patch for typedef destructors


> > 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();
+ }
+


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]