summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-29 07:16:50 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-29 07:16:50 +0000
commit811f0725df2f68661409cbb1b12652c1bee71984 (patch)
treefe1af43214d3f93042b4592ab7f9b90af27cb88e
parent7a33f5107a650c9d6b2527fe4d8c81b76d5e4624 (diff)
downloadppe42-gcc-811f0725df2f68661409cbb1b12652c1bee71984.tar.gz
ppe42-gcc-811f0725df2f68661409cbb1b12652c1bee71984.zip
PR c++/17695
* decl.c (grokdeclarator): Mark TYPE_DECLs as abstract when they appear in a constructor/destructor that will be cloned. PR c++/17695 * g++.dg/debug/typedef2.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89819 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/debug/typedef2.C12
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5aa869c5320..5fca4cbea40 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/17695
+ * decl.c (grokdeclarator): Mark TYPE_DECLs as abstract when they
+ appear in a constructor/destructor that will be cloned.
+
1004-10-28 Matt Austern <austern@apple.com>
PR c++/14124
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 4d74a2a2e65..c435e488bb4 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7619,6 +7619,14 @@ grokdeclarator (const cp_declarator *declarator,
error ("%Jtypedef name may not be a nested-name-specifier", decl);
if (!current_function_decl)
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
+ else if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (current_function_decl)
+ || (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P
+ (current_function_decl)))
+ /* The TYPE_DECL is "abstract" because there will be
+ clones of this constructor/destructor, and there will
+ be copies of this TYPE_DECL generated in those
+ clones. */
+ DECL_ABSTRACT (decl) = 1;
}
/* If the user declares "typedef struct {...} foo" then the
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1e061f4ec9a..089fc6428d5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/17695
+ * g++.dg/debug/typedef2.C: New test.
+
2004-10-29 David Billinghurst <David.Billinghurst@riotinto.com>
PR fortran/13490
diff --git a/gcc/testsuite/g++.dg/debug/typedef2.C b/gcc/testsuite/g++.dg/debug/typedef2.C
new file mode 100644
index 00000000000..a216242c7bc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/typedef2.C
@@ -0,0 +1,12 @@
+// PR c++/17695
+
+template<typename T> struct A
+{
+ T t;
+ A();
+};
+
+struct B
+{
+ B() { typedef int C; A<C> a; }
+} b;
OpenPOWER on IntegriCloud