+2004-09-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/17620
+ * decl.c (xref_basetypes): Look through typedefs before checking
+ for duplicate base.
+
2004-09-22 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
continue;
}
- if (TYPE_MARKED_P (basetype))
- {
- if (basetype == ref)
- error ("recursive type `%T' undefined", basetype);
- else
- error ("duplicate base type `%T' invalid", basetype);
- continue;
- }
- TYPE_MARKED_P (basetype) = 1;
-
if (TYPE_FOR_JAVA (basetype) && (current_lang_depth () == 0))
TYPE_FOR_JAVA (ref) = 1;
CLASSTYPE_REPEATED_BASE_P (ref)
|= CLASSTYPE_REPEATED_BASE_P (basetype);
}
+
+ /* We must do this test after we've seen through a typedef
+ type. */
+ if (TYPE_MARKED_P (basetype))
+ {
+ if (basetype == ref)
+ error ("recursive type `%T' undefined", basetype);
+ else
+ error ("duplicate base type `%T' invalid", basetype);
+ continue;
+ }
+ TYPE_MARKED_P (basetype) = 1;
base_binfo = copy_binfo (base_binfo, basetype, ref,
&igo_prev, via_virtual);
+2004-09-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/17620
+ * g++.dg/inherit/base2.C: New.
+
2004-09-22 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/20001012-1.c: Add prototypes for builtin functions.
--- /dev/null
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 23 Sep 2004 <nathan@codesourcery.com>
+
+// Origin: Wolfgang Bangerth <bangerth@dealii.org>
+// Bug 17620. Bogus duplicate base error.
+
+struct S {};
+
+typedef S B;
+
+struct D1 : B {};
+struct D2 : B {};