Commit c8460010 by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/7768 (__PRETTY_FUNCTION__ for template destructor is wrong)

cp:
	PR c++/7768
	* pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
testsuite:
	* g++.dg/template/pretty1.C: New test

From-SVN: r57152
parent 981f97c3
2002-09-14 Nathan Sidwell <nathan@codesourcery.com>
PR c++/7768
* pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
2002-09-14 Kazu Hirata <kazu@cs.umass.edu>
* error.c: Fix comment formatting.
......
......@@ -2110,6 +2110,7 @@ build_template_decl (decl, parms)
DECL_VIRTUAL_CONTEXT (tmpl) = DECL_VIRTUAL_CONTEXT (decl);
DECL_STATIC_FUNCTION_P (tmpl) = DECL_STATIC_FUNCTION_P (decl);
DECL_CONSTRUCTOR_P (tmpl) = DECL_CONSTRUCTOR_P (decl);
DECL_DESTRUCTOR_P (tmpl) = DECL_DESTRUCTOR_P (decl);
DECL_NONCONVERTING_P (tmpl) = DECL_NONCONVERTING_P (decl);
DECL_ASSIGNMENT_OPERATOR_P (tmpl) = DECL_ASSIGNMENT_OPERATOR_P (decl);
if (DECL_OVERLOADED_OPERATOR_P (decl))
......
2002-09-15 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/template/pretty1.C: New test.
2002-09-14 Alan Modra <amodra@bigpond.net.au>
* gcc.c-torture/execute/struct-cpy-1.c: New test.
......
// { dg-do run }
// Copyright (C) 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 14 Sep 2002 <nathan@codesourcery.com>
// PR 7768 template dtor pretty function wrong
#include <string.h>
static size_t current = 0;
static bool error = false;
static char const *names[] =
{
"X<T>::X() [with T = void]",
"X<T>::~X() [with T = void]",
0
};
void Verify (char const *ptr)
{
error = strcmp (ptr, names[current++]);
}
template <typename T>
struct X
{
X() { Verify (__PRETTY_FUNCTION__); }
~X() { Verify (__PRETTY_FUNCTION__); }
};
int main()
{
{
X<void> x;
if (error)
return current;
}
if (error)
return current;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment