diff options
author | Jason Merrill <jason@redhat.com> | 2011-07-11 14:52:12 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-07-11 14:52:12 -0400 |
commit | 4904b64bf7dc5538b06d2ba01fc1c55231c09bb8 (patch) | |
tree | 3256896a64479248e6b7bfbaeb3af03b35d3636e /gcc/cp/decl2.c | |
parent | 848ca96f30746fc6972105de156656ce8c5ee586 (diff) | |
download | gcc-4904b64bf7dc5538b06d2ba01fc1c55231c09bb8.zip gcc-4904b64bf7dc5538b06d2ba01fc1c55231c09bb8.tar.gz gcc-4904b64bf7dc5538b06d2ba01fc1c55231c09bb8.tar.bz2 |
re PR c++/44609 (Invalid template code causes infinite loop of error messages)
PR c++/44609
* cp-tree.h (struct tinst_level): Add errors field.
* pt.c (neglectable_inst_p, limit_bad_template_recurson): New.
(push_tinst_level): Don't start another decl in that case.
(reopen_tinst_level): Adjust errors field.
* decl2.c (cp_write_global_declarations): Don't complain about
undefined inline if its template was defined.
* mangle.c (mangle_decl_string): Handle failure from push_tinst_level.
From-SVN: r176176
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 8cd51c2..d90d4b5 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -3950,10 +3950,10 @@ cp_write_global_declarations (void) #pragma interface, etc.) we decided not to emit the definition here. */ && !DECL_INITIAL (decl) - /* An explicit instantiation can be used to specify - that the body is in another unit. It will have - already verified there was a definition. */ - && !DECL_EXPLICIT_INSTANTIATION (decl)) + /* Don't complain if the template was defined. */ + && !(DECL_TEMPLATE_INSTANTIATION (decl) + && DECL_INITIAL (DECL_TEMPLATE_RESULT + (template_for_substitution (decl))))) { warning (0, "inline function %q+D used but never defined", decl); /* Avoid a duplicate warning from check_global_declaration_1. */ |