summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch')
-rw-r--r--sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch b/sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch
new file mode 100644
index 0000000..72b4910
--- /dev/null
+++ b/sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch
@@ -0,0 +1,65 @@
+2002-09-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/7768
+ * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
+
+2002-09-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/template/pretty1.C: New test.
+
+--- gcc-3.2.1/gcc/cp/pt.c.pr7768 2003-01-20 14:14:15.000000000 +0100
++++ gcc-3.2.1/gcc/cp/pt.c 2003-02-08 14:42:15.000000000 +0100
+@@ -2108,6 +2108,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))
+--- gcc-3.2.1/gcc/testsuite/g++.dg/template/pretty1.C.pr7768 2003-02-08 14:42:03.000000000 +0100
++++ gcc-3.2.1/gcc/testsuite/g++.dg/template/pretty1.C 2003-02-08 14:41:52.000000000 +0100
+@@ -0,0 +1,43 @@
++// { 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;
++}