+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
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");
|| 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.
--- /dev/null
+// { 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|;" }
+}