aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-01-29 02:21:51 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-01-29 02:21:51 +0000
commitb1a95e0b150a9423dd4ad8b9fdc97426cfa7764f (patch)
treecafd844b692303df44cc7d8087c98289e4c221df /gcc
parentdc7efe6ea91a0ce3c619490c254529c33ba56f2b (diff)
downloadgcc-b1a95e0b150a9423dd4ad8b9fdc97426cfa7764f.zip
gcc-b1a95e0b150a9423dd4ad8b9fdc97426cfa7764f.tar.gz
gcc-b1a95e0b150a9423dd4ad8b9fdc97426cfa7764f.tar.bz2
re PR c++/13791 (ICE in layout_type with packed types)
PR c++/13791 * typeck.c (merge_types): Do not merge attributes into TYPENAME_TYPEs. 2004-01-28 Mark Mitchell <mark@codesourcery.com> PR c++/13791 * g++.dg/ext/attrib12.C: New test. From-SVN: r76837
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/typeck.c6
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib12.C16
4 files changed, 29 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 73451be..873a79f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2004-01-28 Mark Mitchell <mark@codesourcery.com>
+ PR c++/13791
+ * typeck.c (merge_types): Do not merge attributes into
+ TYPENAME_TYPEs.
+
PR c++/13736
* parser.c (cp_parser_direct_declarator): Do not prevent
backtracking inside a parenthesized declarator.
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index b2dfe64..137cede 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -714,6 +714,12 @@ merge_types (tree t1, tree t2)
break;
}
+ case TYPENAME_TYPE:
+ /* There is no need to merge attributes into a TYPENAME_TYPE.
+ When the type is instantiated it will have whatever
+ attributes result from the instantiation. */
+ return t1;
+
default:;
}
return build_type_attribute_variant (t1, attributes);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4a498e7..d5cbccb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2004-01-28 Mark Mitchell <mark@codesourcery.com>
+ PR c++/13791
+ * g++.dg/ext/attrib12.C: New test.
+
PR c++/13736
* g++.dg/parse/cast2.C: New test.
diff --git a/gcc/testsuite/g++.dg/ext/attrib12.C b/gcc/testsuite/g++.dg/ext/attrib12.C
new file mode 100644
index 0000000..aea9378
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attrib12.C
@@ -0,0 +1,16 @@
+// PR c++/13791
+
+template <typename T> struct O {
+ struct __attribute__((packed)) I {
+ int i;
+ char c;
+ };
+
+ I* foo();
+};
+
+template <typename T>
+typename O<T>::I*
+O<T>::foo() { return 0; }
+
+template class O<int>;