diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2001-12-29 17:12:55 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2001-12-29 17:12:55 +0000 |
commit | f3368a9098c3aa67ef422208978bf8df6353bc5a (patch) | |
tree | 354ae308751707a6a244e6e77df4cf138834626a /gcc | |
parent | 03c9c274624a94356dffd1cd62ff9669a8a1039a (diff) | |
download | gcc-f3368a9098c3aa67ef422208978bf8df6353bc5a.zip gcc-f3368a9098c3aa67ef422208978bf8df6353bc5a.tar.gz gcc-f3368a9098c3aa67ef422208978bf8df6353bc5a.tar.bz2 |
re PR c++/5125 (both g++ 3.0.1 and 2.95.3 crash with internal error when trying compile template method with parameter pointer to method)
cp:
PR c++/5125
* pt.c (push_template_decl_real): Make sure DECL has
DECL_LANG_SPECIFIC.
testsuite:
* g++.dg/template/crash1.C: New test.
From-SVN: r48370
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/crash1.C | 17 |
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 77d4c5d..b910195 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2001-12-29 Nathan Sidwell <nathan@codesourcery.com> + PR c++/5125 + * pt.c (push_template_decl_real): Make sure DECL has + DECL_LANG_SPECIFIC. + +2001-12-29 Nathan Sidwell <nathan@codesourcery.com> + PR c++/335 * init.c (resolve_offset_ref): Copy cv qualifiers of this pointer for non-reference fields. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index cd43d4c..de24a05 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2627,7 +2627,7 @@ push_template_decl_real (decl, is_friend) return decl; } } - else if (! DECL_TEMPLATE_INFO (decl)) + else if (!DECL_LANG_SPECIFIC (decl) || !DECL_TEMPLATE_INFO (decl)) { error ("template definition of non-template `%#D'", decl); return decl; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 89cf025..91fd37d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2001-12-29 Nathan Sidwell <nathan@codesourcery.com> + * g++.dg/template/crash1.C: New test. + +2001-12-29 Nathan Sidwell <nathan@codesourcery.com> + * g++.dg/other/const1.C: New test. 2001-12-29 Hans-Peter Nilsson <hp@bitrange.com> diff --git a/gcc/testsuite/g++.dg/template/crash1.C b/gcc/testsuite/g++.dg/template/crash1.C new file mode 100644 index 0000000..27e8964 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash1.C @@ -0,0 +1,17 @@ +// { dg-do compile } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 29 Dec 2001 <nathan@nathan@codesourcery.com> + +// PR 5125. ICE + +class S +{ + public: + template <class I> void Foo(int (*f)(S& o) ); // { dg-error "candidate" "" } +}; + +template <class I> +void S::Foo(int (*f)(TYPO&o) ) +{ // { dg-error "template definition of non-template|prototype" "" } +} |