1// { dg-do run }
2
3// Copyright (C) 2002 Free Software Foundation, Inc.
4// Contributed by Nathan Sidwell 14 Sep 2002 <nathan@codesourcery.com>
5
6// PR 7768 template dtor pretty function wrong
7
8#include <string.h>
9
10static size_t current = 0;
11static bool error = false;
12
13static char const *names[] =
14{
15  "X<T>::X() [with T = void]",
16  "X<T>::~X() [with T = void]",
17  0
18};
19
20void Verify (char const *ptr)
21{
22  error = strcmp (ptr, names[current++]);
23}
24
25template <typename T>
26struct X
27{
28  X() { Verify (__PRETTY_FUNCTION__); }
29  ~X() { Verify (__PRETTY_FUNCTION__); }
30};
31
32int main()
33{
34  {
35    X<void> x;
36
37    if (error)
38      return current;
39  }
40  if (error)
41    return current;
42  return 0;
43}
44