OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [pretty1.C] - Blame information for rev 149

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.