diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-17 22:35:49 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-17 22:35:49 +0000 |
commit | 6e5bd8b06ad4c1bb84cb0ec404a02197b5f9a2fe (patch) | |
tree | 5cdba7989d8cddde4acdc126e1fbda9376d48428 | |
parent | 1e1e2582f25f1db416359ee87252b9b409101e81 (diff) | |
download | gcc-6e5bd8b06ad4c1bb84cb0ec404a02197b5f9a2fe.tar.gz |
PR c++/7584
* class.c (handle_using_decl): Allow the declaration used to be
from an ambiguous base.
PR c++/7584
* g++.dg/inherit/using3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58262 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/class.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/inherit/using3.C | 19 |
4 files changed, 33 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4f0b230a962..b6836eef407 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2002-10-17 Mark Mitchell <mark@codesourcery.com> + PR c++/7584 + * class.c (handle_using_decl): Allow the declaration used to be + from an ambiguous base. + * pt.c (convert_template_argument): Revert this change: 2002-10-16 Mark Mitchell <mark@codesourcery.com> * pt.c (convert_template_argument): Do not fold non-type diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 59f5ce37fc1..90d7ef2c921 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -1155,9 +1155,12 @@ handle_using_decl (using_decl, t) tree flist = NULL_TREE; tree old_value; - binfo = binfo_or_else (ctype, t); + binfo = lookup_base (t, ctype, ba_any, NULL); if (! binfo) - return; + { + error_not_base_type (t, ctype); + return; + } if (constructor_name_p (name, ctype)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 09ea6636ff6..89befc5692b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-10-17 Mark Mitchell <mark@codesourcery.com> + + PR c++/7584 + * g++.dg/inherit/using3.C: New test. + Thu Oct 17 19:12:58 CEST 2002 Jan Hubicka <jh@suse.cz> * gcc.dg/20021017-2.c: New test. diff --git a/gcc/testsuite/g++.dg/inherit/using3.C b/gcc/testsuite/g++.dg/inherit/using3.C new file mode 100644 index 00000000000..d2acf80099a --- /dev/null +++ b/gcc/testsuite/g++.dg/inherit/using3.C @@ -0,0 +1,19 @@ +class A +{ +public: + typedef int T; + int a; +}; + +class B : virtual private A +{ +}; + +class C : virtual private A, public B +{ +public: + using A::a; + using A::T; +}; + +C::T x; |