aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-09-23 10:09:09 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-09-23 10:09:09 +0000
commit98d6e9afea98c81a0cb3fa9e1d5622d474dd52e1 (patch)
tree9e32da01f4dd9f74821e87be2227b9646e5b67d7 /gcc/cp
parente5a067e81a6f05552064e2d1224c278724ba4ca6 (diff)
downloadgcc-98d6e9afea98c81a0cb3fa9e1d5622d474dd52e1.zip
gcc-98d6e9afea98c81a0cb3fa9e1d5622d474dd52e1.tar.gz
gcc-98d6e9afea98c81a0cb3fa9e1d5622d474dd52e1.tar.bz2
re PR c++/17620 (Bogus error with duplicate base class breaks boost)
cp: PR c++/17620 * decl.c (xref_basetypes): Look through typedefs before checking for duplicate base. testsuite: PR c++/17620 * g++.dg/inherit/base2.C: New. From-SVN: r87938
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c22
2 files changed, 18 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e91d425..2d22a59 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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).
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 73f54d9..30bfa8b 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9286,16 +9286,6 @@ xref_basetypes (tree ref, tree base_list)
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;
@@ -9318,6 +9308,18 @@ xref_basetypes (tree ref, tree base_list)
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);