+2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/12288
+ * parser.c (cp_parser_parameter_declaration): Check return value
+ of cp_parser_parse_and_diagnose_invalid_type_name.
+
2013-05-20 Jason Merrill <jason@redhat.com>
PR c++/57319
&declares_class_or_enum);
/* Complain about missing 'typename' or other invalid type names. */
- if (!decl_specifiers.any_type_specifiers_p)
- cp_parser_parse_and_diagnose_invalid_type_name (parser);
+ if (!decl_specifiers.any_type_specifiers_p
+ && cp_parser_parse_and_diagnose_invalid_type_name (parser))
+ decl_specifiers.type = error_mark_node;
/* If an error occurred, there's no reason to attempt to parse the
rest of the declaration. */
+2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/12288
+ * g++.dg/parse/error52.C: New.
+ * g++.dg/parse/error3.C: Adjust.
+ * g++.dg/parse/error36.C: Likewise.
+
2013-05-20 Oleg Endo <olegendo@gcc.gnu.org>
PR target/56547
void(*AddFunction)(const TYPE&,bool&,
char*, char*,
unsigned*));
-// { dg-error "64: ISO C\\+\\+ forbids declaration of 'parameter' with no type" "forbids" { target *-*-* } { 5 } }
// { dg-error "60: 'TYPE' does not name a type" "does not" { target *-*-* } { 5 } }
// PR c++/40738
template <class T>
void g(const A<T>::type &t); // { dg-error "typename" "typename" }
-// { dg-error "no type" "no type" { target *-*-* } 28 }
// PR c++/18451
template <class T> A<T>::B A<T>::b; // { dg-error "typename" }
--- /dev/null
+// PR c++/12288
+
+class X {};
+
+struct S {
+ explicit S (const X::T&) {} // { dg-error "does not name a type" }
+};
+
+class Y {};
+
+typedef Y::T xt; // { dg-error "does not name a type" }