From: Jason Merrill Date: Thu, 23 Apr 2015 13:20:08 +0000 (-0400) Subject: re PR c++/65721 (Internal compiler error segmentation fault) X-Git-Tag: releases/gcc-4.8.5~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5991af91cca39fbf9dee3b2a5d4ddde4023b62e;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: r222363 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9239750e4723..e8835aea547e 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-01-13 Jason Merrill PR c++/64487 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index da167ec41587..9091e75e2304 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3288,7 +3288,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; +}