diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-01 17:36:00 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-01 17:36:00 +0000 |
commit | 1bcd2da1b88f61134d3fce1fab18112b47d6c6d7 (patch) | |
tree | e759765f002989b910b272e3f75bc1701cf087b7 | |
parent | 974158578f2d5c5c5eb48e24902b407224f3ec1c (diff) | |
download | gcc-1bcd2da1b88f61134d3fce1fab18112b47d6c6d7.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68782 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/call.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/scoped6.C | 17 |
4 files changed, 30 insertions, 0 deletions
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 <mark@codesourcery.com> + + PR c++/11149 + * call.c (resolve_scoped_fn_name): Check that the qualifying scope + is a class type. + 2003-07-01 Giovanni Bajo <giovannibajo@libero.it> 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 <mark@codesourcery.com> + + PR c++/11149 + * g++.dg/lookup/scoped6.C: New test. + 2003-07-01 Giovanni Bajo <giovannibajo@libero.it> 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 <typename X> +class Foo { + int i; +public: + Foo() { + X::explode(); // { dg-error "" } + } +}; + +class Bar { + Foo<int> foo_; +public: + Bar() {} // { dg-error "instantiated" } +}; + +template class Foo<int>; + |