* decl.c (pushdecl): Don't copy types if the
DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the
type.
From-SVN: r22381
+1998-09-10 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (pushdecl): Don't copy types if the
+ DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the
+ type.
+
1998-09-09 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
* class.c (get_enclosing_class): New function.
if (TYPE_NAME (type) == 0)
TYPE_NAME (type) = x;
}
- else if (type != error_mark_node && TYPE_NAME (type) != x)
+ else if (type != error_mark_node && TYPE_NAME (type) != x
+ /* We don't want to copy the type when all we're
+ doing is making a TYPE_DECL for the purposes of
+ inlining. */
+ && (!TYPE_NAME (type)
+ || TYPE_NAME (type) != DECL_ABSTRACT_ORIGIN (x)))
{
push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
--- /dev/null
+// Build don't link:
+// Special g++ Options: -g -O2
+
+inline void f() {
+ struct S {};
+ S s;
+}
+
+int g()
+{
+ for (int i = 0; i < 2; ++i)
+ f();
+}
+