Commit 11325dcd by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

PR c++/9781, c++/10583, c++/11862

	PR c++/9781, c++/10583, c++/11862
	* decl.c (cp_finish_decl): Exit immediately if decl is an
	error_mark_node.
	* pt.c (push_template_decl_real): Return error_mark_node for
	invalid template declaration of variable.

	* g++.dg/parse/crash13.C: New test.

From-SVN: r72701
parent adccacc4
2003-10-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9781, c++/10583, c++/11862
* decl.c (cp_finish_decl): Exit immediately if decl is an
error_mark_node.
* pt.c (push_template_decl_real): Return error_mark_node for
invalid template declaration of variable.
2003-10-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/12495
......
......@@ -4658,7 +4658,9 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
const char *asmspec = NULL;
int was_readonly = 0;
if (! decl)
if (decl == error_mark_node)
return;
else if (! decl)
{
if (init)
error ("assignment (not initialization) in declaration");
......
......@@ -2690,7 +2690,10 @@ push_template_decl_real (tree decl, int is_friend)
|| TREE_CODE (decl) == FUNCTION_DECL)
/* OK */;
else
error ("template declaration of `%#D'", decl);
{
error ("template declaration of `%#D'", decl);
return error_mark_node;
}
}
/* Check to see that the rules regarding the use of default
......
2003-10-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9781, c++/10583, c++/11862
* g++.dg/parse/crash13.C: New test.
2003-10-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* gcc.dg/old-style-asm-1.c: Count jump_insns instead of labels.
......
// { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo@libero.it>
// PR c++/10583: ICE using template function with invalid signature.
template <typename>
struct A
{
struct B
{};
};
template <typename T>
void func(A<T>::B* ) // { dg-error "variable|template|expression" }
{ // { dg-error ";" }
}
int main()
{
func<void>(0); // { dg-error "undeclared|expression|;" }
}
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