From: Jason Merrill Date: Thu, 23 Apr 2015 13:21:11 +0000 (-0400) Subject: re PR c++/65721 (Internal compiler error segmentation fault) X-Git-Tag: releases/gcc-4.9.3~192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3e1206d9081464144418e7ba88fd89ae77840fb;p=thirdparty%2Fgcc.git re PR c++/65721 (Internal compiler error segmentation fault) PR c++/65721 * name-lookup.c (do_class_using_decl): Complain about specifying the current class even if there are dependent bases. From-SVN: r222366 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index db4228f1fa29..0166bee588bf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-04-23 Jason Merrill + + PR c++/65721 + * name-lookup.c (do_class_using_decl): Complain about specifying + the current class even if there are dependent bases. + 2015-04-23 David Krauss PR c++/59766 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 0137c3f4a337..b76cf0808f58 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3381,7 +3381,7 @@ do_class_using_decl (tree scope, tree name) tf_warning_or_error); if (b_kind < bk_proper_base) { - if (!bases_dependent_p) + if (!bases_dependent_p || b_kind == bk_same_type) { error_not_base_type (scope, current_class_type); return NULL_TREE; diff --git a/gcc/testsuite/g++.dg/lookup/using55.C b/gcc/testsuite/g++.dg/lookup/using55.C new file mode 100644 index 000000000000..61098b186fb3 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using55.C @@ -0,0 +1,19 @@ +// PR c++/65721 + +template +struct A { + typedef T D; +}; + +template +class B : public A { + using typename B::D; // { dg-error "not a base" } +public: + D echo(D x) { // { dg-error "D" } + return x; + } +}; + +int main() { + B b; +}