diff options
author | Jason Merrill <jason@redhat.com> | 2015-04-14 11:29:34 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2015-04-14 11:29:34 -0400 |
commit | 0f19e7adef3f2818fd0b363306791c23b0656b62 (patch) | |
tree | f9ada431677cd0ac0ee688c4c08a73eaee87b231 /gcc | |
parent | 688e531e4b84d9250646715658179a5f72753609 (diff) | |
download | gcc-0f19e7adef3f2818fd0b363306791c23b0656b62.zip gcc-0f19e7adef3f2818fd0b363306791c23b0656b62.tar.gz gcc-0f19e7adef3f2818fd0b363306791c23b0656b62.tar.bz2 |
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: r222096
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/using55.C | 19 |
3 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 10df58f..03f6f2a4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-04-14 Jason Merrill <jason@redhat.com> + + PR c++/65721 + * name-lookup.c (do_class_using_decl): Complain about specifying + the current class even if there are dependent bases. + 2015-04-14 David Krauss <david_work@me.com> PR c++/59766 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index e3f7cca..9e4e0e3 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3408,7 +3408,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 0000000..61098b1 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using55.C @@ -0,0 +1,19 @@ +// PR c++/65721 + +template<typename T> +struct A { + typedef T D; +}; + +template<typename X> +class B : public A<X> { + using typename B::D; // { dg-error "not a base" } +public: + D echo(D x) { // { dg-error "D" } + return x; + } +}; + +int main() { + B<int> b; +} |