Commit 9bbc9565 by Paolo Carlini Committed by Paolo Carlini

re PR c++/12288 (unintelligible error message for constructor declaration with misspelled type)

/cp
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.

/testsuite
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.

From-SVN: r199115
parent 32bfcf80
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
......
......@@ -17844,8 +17844,9 @@ cp_parser_parameter_declaration (cp_parser *parser,
&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
......
......@@ -5,5 +5,4 @@ static void InstantiateConstraint(const float&, unsigned,
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 } }
......@@ -26,7 +26,6 @@ template <class T> struct B
// 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" }
// 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" }
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