if (!val->types_set)
val->types_set = new hash_set<tree>;
+ /* Chose polymorphic type as leader (this happens only in case of ODR
+ violations. */
+ if ((TREE_CODE (type) == RECORD_TYPE && TYPE_BINFO (type)
+ && polymorphic_type_binfo_p (TYPE_BINFO (type)))
+ && (TREE_CODE (val->type) != RECORD_TYPE || !TYPE_BINFO (val->type)
+ || !polymorphic_type_binfo_p (TYPE_BINFO (val->type))))
+ {
+ prevail = true;
+ build_bases = true;
+ }
/* Always prefer complete type to be the leader. */
-
- if (!COMPLETE_TYPE_P (val->type) && COMPLETE_TYPE_P (type))
+ else if (!COMPLETE_TYPE_P (val->type) && COMPLETE_TYPE_P (type))
{
prevail = true;
build_bases = TYPE_BINFO (type);
Be sure this does not happen. */
gcc_assert (TYPE_BINFO (type2)
|| !polymorphic_type_binfo_p (TYPE_BINFO (type1))
- || build_bases);
+ || build_bases
+ || val->odr_violated);
break;
}
/* One base is polymorphic and the other not.
fprintf (f, "%s\n", t->all_derivations_known ? " (derivations known)":"");
if (TYPE_NAME (t->type))
{
- fprintf (f, "%*s defined at: %s:%i\n", indent * 2, "",
+ /*fprintf (f, "%*s defined at: %s:%i\n", indent * 2, "",
DECL_SOURCE_FILE (TYPE_NAME (t->type)),
- DECL_SOURCE_LINE (TYPE_NAME (t->type)));
+ DECL_SOURCE_LINE (TYPE_NAME (t->type)));*/
if (DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (t->type)))
fprintf (f, "%*s mangled name: %s\n", indent * 2, "",
IDENTIFIER_POINTER
--- /dev/null
+namespace std {
+template <typename, typename = int> class Trans_NS___cxx11_basic_ostringstream;
+class ios_base {
+ class __attribute((__abi_tag__("cxx11"))) failure {
+ virtual char m_fn2();
+ };
+};
+class B : virtual ios_base {};
+template <typename, typename> class Trans_NS___cxx11_basic_ostringstream : B {
+public:
+ void m_fn1();
+};
+}
+
+class A {
+public:
+ A(int) {
+ std::Trans_NS___cxx11_basic_ostringstream<wchar_t> a;
+ a.m_fn1();
+ }
+};
+int b;
+void fn1() { (A(b)); }
+int
+main()
+{
+}