* decl.c (grokdeclarator): Return error_mark_node on
declaration with two or more data types.
* g++.dg/template/typedef6.C: New test.
* g++.dg/init/error1.C: Adjust error markers.
* g++.dg/parse/crash9.C: Likewise.
* g++.dg/template/crash55.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117118
138bc75d-0d04-0410-961f-
82ee72b054a4
PR c++/28861
* decl.c (shadow_tag): Return error_mark_node
if maybe_process_partial_specialization failed.
+
+ PR c++/28303
+ * decl.c (grokdeclarator): Return error_mark_node on
+ declaration with two or more data types.
2006-09-20 Danny Smith <dannysmith@users.sourceforge.net>
/* If there were multiple types specified in the decl-specifier-seq,
issue an error message. */
if (declspecs->multiple_types_p)
- error ("two or more data types in declaration of %qs", name);
+ {
+ error ("two or more data types in declaration of %qs", name);
+ return error_mark_node;
+ }
+
/* Extract the basic type from the decl-specifier-seq. */
type = declspecs->type;
if (type == error_mark_node)
PR c++/28861
* g++.dg/template/spec32.C: New test.
* g++.dg/parse/crash9.C: Adjust error markers.
+
+ PR c++/28303
+ * g++.dg/template/typedef6.C: New test.
+ * g++.dg/init/error1.C: Adjust error markers.
+ * g++.dg/parse/crash9.C: Likewise.
+ * g++.dg/template/crash55.C: Likewise.
2006-09-21 Janis Johnson <janis187@us.ibm.com>
// PR c++/12696
struct A {
- static float b[10]; // { dg-error "" }
+ static float b[10];
}
float A::b[] = {1,2,3}; // { dg-error "" }
//PR c++/27668
template<typename class T, T = T()> // { dg-error "nested-name-specifier|two or more|valid type" }
-struct A {}; // { dg-error "definition"
+struct A {}; // { dg-error "definition|template" }
template<int> void foo(A<int>); // { dg-error "mismatch|constant|template argument" }
--- /dev/null
+//PR c++/28303
+
+template<typename T> struct A
+{
+ typedef struct typename T::X X; // { dg-error "expected identifier|two or more" }
+};
+
+template<typename T> A<T>::X::X() {} // { dg-error "not a type|forbids declaration" }