2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / template / pretty1.C
blob99cbcd64a5521cbaf1bb00fca462fc6d5cfd5a56
1 // { dg-do run }
3 // Copyright (C) 2002 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 14 Sep 2002 <nathan@codesourcery.com>
6 // PR 7768 template dtor pretty function wrong
8 #include <string.h>
10 static size_t current = 0;
11 static bool error = false;
13 static char const *names[] =
15   "X<T>::X() [with T = void]",
16   "X<T>::~X() [with T = void]",
17   0
20 void Verify (char const *ptr)
22   error = strcmp (ptr, names[current++]);
24   
25 template <typename T>
26 struct X
28   X() { Verify (__PRETTY_FUNCTION__); }
29   ~X() { Verify (__PRETTY_FUNCTION__); }
32 int main()
34   {
35     X<void> x;
36     
37     if (error)
38       return current;
39   }
40   if (error)
41     return current;
42   return 0;