* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76837
138bc75d-0d04-0410-961f-
82ee72b054a4
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.
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);
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.
--- /dev/null
+// 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>;