Commit 8259e4f5 by Paolo Carlini Committed by Paolo Carlini

re PR c++/30659 (ICE in undefined template)

cp/
2007-10-28  Paolo Carlini  <pcarlini@suse.de>
	    Mark Mitchell  <mark@codesourcery.com>

	PR c++/30659
	* pt.c (do_decl_instantiation): If the VAR_DECL is not a
	class member error out and return.

testsuite/
2007-10-28  Paolo Carlini  <pcarlini@suse.de>
	    Mark Mitchell  <mark@codesourcery.com>

	PR c++/30659
	* g++.dg/template/crash71.C: New.

Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r129710
parent a9077d27
2007-10-28 Paolo Carlini <pcarlini@suse.de>
Mark Mitchell <mark@codesourcery.com>
PR c++/30659
* pt.c (do_decl_instantiation): If the VAR_DECL is not a
class member error out and return.
2007-10-27 Jakub Jelinek <jakub@redhat.com> 2007-10-27 Jakub Jelinek <jakub@redhat.com>
* error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
......
...@@ -13882,6 +13882,11 @@ do_decl_instantiation (tree decl, tree storage) ...@@ -13882,6 +13882,11 @@ do_decl_instantiation (tree decl, tree storage)
VAR_DECLs so we do the lookup here. Probably, grokdeclarator VAR_DECLs so we do the lookup here. Probably, grokdeclarator
should handle VAR_DECLs as it currently handles should handle VAR_DECLs as it currently handles
FUNCTION_DECLs. */ FUNCTION_DECLs. */
if (!DECL_CLASS_SCOPE_P (decl))
{
error ("%qD is not a static data member of a class template", decl);
return;
}
result = lookup_field (DECL_CONTEXT (decl), DECL_NAME (decl), 0, false); result = lookup_field (DECL_CONTEXT (decl), DECL_NAME (decl), 0, false);
if (!result || TREE_CODE (result) != VAR_DECL) if (!result || TREE_CODE (result) != VAR_DECL)
{ {
......
2007-10-28 Paolo Carlini <pcarlini@suse.de>
Mark Mitchell <mark@codesourcery.com>
PR c++/30659
* g++.dg/template/crash71.C: New.
2007-10-28 Tobias Schlter <tobi@gcc.gnu.org> 2007-10-28 Tobias Schlter <tobi@gcc.gnu.org>
PR fortran/32147 PR fortran/32147
// PR c++/30659
extern "C" template A<char> foo(); // { dg-error "forbids|static data|expected" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment