From: Mark Mitchell Date: Tue, 1 Jul 2003 17:36:00 +0000 (+0000) Subject: re PR c++/11149 (ICE on error when instantiation with call function of a base type) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=62bfce90da38001c15c416e3a605b1ed2ad7049f;p=gcc.git re PR c++/11149 (ICE on error when instantiation with call function of a base type) PR c++/11149 * call.c (resolve_scoped_fn_name): Check that the qualifying scope is a class type. PR c++/11149 * g++.dg/lookup/scoped6.C: New test. From-SVN: r68782 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5487d3375a7..e9180bfeb85 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-07-01 Mark Mitchell + + PR c++/11149 + * call.c (resolve_scoped_fn_name): Check that the qualifying scope + is a class type. + 2003-07-01 Giovanni Bajo PR c++/8046 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index d92a24e699a..0f4d360496a 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2765,6 +2765,8 @@ resolve_scoped_fn_name (tree scope, tree name) if (TREE_CODE (scope) == NAMESPACE_DECL) fn = lookup_namespace_name (scope, name); + else if (!CLASS_TYPE_P (scope)) + error ("`%T' is not a class type", scope); else { if (!TYPE_BEING_DEFINED (scope) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 95e4e01d48a..86cabcb6cfa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-07-01 Mark Mitchell + + PR c++/11149 + * g++.dg/lookup/scoped6.C: New test. + 2003-07-01 Giovanni Bajo PR c++/8046 diff --git a/gcc/testsuite/g++.dg/lookup/scoped6.C b/gcc/testsuite/g++.dg/lookup/scoped6.C new file mode 100644 index 00000000000..d9566a7e099 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/scoped6.C @@ -0,0 +1,17 @@ +template +class Foo { + int i; +public: + Foo() { + X::explode(); // { dg-error "" } + } +}; + +class Bar { + Foo foo_; +public: + Bar() {} // { dg-error "instantiated" } +}; + +template class Foo; +