diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-23 10:09:09 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-23 10:09:09 +0000 |
commit | 9f0da84b01eb463e924c427f0783632136400ecf (patch) | |
tree | 9e32da01f4dd9f74821e87be2227b9646e5b67d7 /gcc/cp/decl.c | |
parent | 8f31ca8badb6d456462fb775d33c698d06ef7485 (diff) | |
download | gcc-9f0da84b01eb463e924c427f0783632136400ecf.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87938 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 73f54d92809..30bfa8b6ef6 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); |