* mangle.c (write_unqualified_name): Handle template parm
subtitution.
* class.c (build_base_field): Set DECL_PACKED.
(layout_class_type): Don't use tail padding of PODs.
From-SVN: r55535
--- /dev/null
+// Red Hat bugzilla 64535
+// Bug: We are allocationg stuff into the tail padding of POD class "A".
+// { dg-do run }
+
+struct A
+{
+ int x;
+ char y;
+};
+
+struct B : public A {
+ virtual void f () {}
+ char z;
+};
+
+A a = { 21, 42 };
+B b;
+
+int
+main (void)
+{
+ b.x = 12;
+ b.y = 24;
+ b.z = 36;
+
+ A *ap = &b;
+
+ *ap = a;
+
+ return (b.z != 36);
+}
--- /dev/null
+// Red Hat bugzilla 65210
+// { dg-do run }
+
+struct A {
+ int a;
+};
+
+struct B : public virtual A {};
+
+struct C {
+ long double c;
+};
+
+struct D : public virtual C {
+ int d;
+};
+
+struct E : public B, public D {
+ int e;
+};
+
+E e;
+
+/* The layout of E should begin with the B-in-E vtable pointer, followed by
+ the D-in-E vtable pointer. The bug was that we used to pad out the D
+ fields for long double alignment. */
+
+int main ()
+{
+ D* dp = &e;
+ unsigned long d_offset = ((char*)dp) - ((char*) &e);
+ return (d_offset != sizeof(void *));
+}
--- /dev/null
+// Red Hat bugzilla 65035
+// Bug: We were encoding the name of the instantiation as 'operator int'
+// rather than 'operator T'.
+// { dg-do compile }
+
+struct C {
+ template <class T>
+ operator T ();
+};
+
+template <class T>
+C::operator T () { return 0; }
+
+template C::operator int ();
+
+// { dg-final { scan-assembler _ZN1CcvT_IiEEv } }