diff options
| author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-22 14:57:09 +0000 |
|---|---|---|
| committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-22 14:57:09 +0000 |
| commit | 6435a844bc3f47ed26e278156c54606cd13bd238 (patch) | |
| tree | fa1afdcf738deb036a74e2c2591c52bebeabefa7 /gcc | |
| parent | ebbf5f12bfabc0ffcc292e65f0c5a5453681ad48 (diff) | |
| download | ppe42-gcc-6435a844bc3f47ed26e278156c54606cd13bd238.tar.gz ppe42-gcc-6435a844bc3f47ed26e278156c54606cd13bd238.zip | |
* pt.c
cp:
* pt.c (get_template_base): Check type is completable.
testsuite:
* g++.dg/template/crash20.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85050 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/cp/pt.c | 4 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/template/crash20.C | 20 |
4 files changed, 32 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 080de524c4f..ce91f8965ed 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2004-07-22 Nathan Sidwell <nathan@codesourcery.com> + + * pt.c (get_template_base): Check type is completable. + 2004-07-21 Eric Christopher <echristo@redhat.com> * decl.c (poplevel): Inline unused variable checking. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b30bd5772b8..ca84b394423 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9458,6 +9458,10 @@ get_template_base (tree tparms, tree targs, tree parm, tree arg) my_friendly_assert (IS_AGGR_TYPE_CODE (TREE_CODE (arg)), 92); arg_binfo = TYPE_BINFO (complete_type (arg)); + if (!arg_binfo) + /* The type could not be completed. */ + return NULL_TREE; + rval = get_template_base_recursive (tparms, targs, parm, arg_binfo, NULL_TREE, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 871b1560d6a..9e20ccc21b4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-07-22 Nathan Sidwell <nathan@codesourcery.com> + + * g++.dg/template/crash20.c: New. + 2004-07-22 David Billinghurst (David.Billinghurst@riotinto.com) * gfortran.dg/g77/970625-2.f Copy from g77.f-torture/execute. diff --git a/gcc/testsuite/g++.dg/template/crash20.C b/gcc/testsuite/g++.dg/template/crash20.C new file mode 100644 index 00000000000..0492b72e35e --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash20.C @@ -0,0 +1,20 @@ +// { dg-do compile } + +// Copyright (C) 2004 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 Jul 2004 <nathan@codesourcery.com> + +// ICE with incompletable type. + +class INC; + +template <typename T> class B {}; + +template<typename T> void Foo (B<T> &); + +void Foo (INC &); + +void Baz (INC *p) +{ + Foo (*p); +} + |

