Commit a668c6ad by Mark Mitchell Committed by Mark Mitchell

re PR c++/9849 (Missing keyword 'template' produces ICE with no diagnostic on…

re PR c++/9849 (Missing keyword 'template' produces ICE with no diagnostic on 3.3 (and unreadable diagnostic on 3.4))

	PR c++/9849
	* g++.dg/template/error4.C: New test.
	* g++.dg/template/nested3.C: Adjust error markers.

	PR c++/9849
	* parser.c (cp_lexer_prev_token): New function.
	(cp_parser_skip_to_closing_parenthesis): Add consume_paren
	parameter.
	(cp_parser_nested_name_specifier_opt): Add is_declaration
	parameter.
	(cp_parser_nested_name_specifier): Likewise.
	(cp_parser_class_or_namespace_name): Likewise.
	(cp_parser_class_name): Likewise.
	(cp_parser_template_id): Likewise.
	(cp_parser_template_name): Likewise.
	(cp_parser_id_expression): Adjust calls to
	cp_parser_nested_name_specifier_op, cp_parser_template_id,
	cp_parser_class_name.
	(cp_parser_unqualified_id): Likewise.
	(cp_parser_postfix_expression): Likewise.
	(cp_parser_pseudo_destructor_name): Likewise.
	(cp_parser_cast_expression): Likewise.
	(cp_parser_mem_initializer_id): Likewise.
	(cp_parser_simple_type_specifier): Likewise.
	(cp_parser_type_name): Likewise.
	(cp_parser_elaborated_type_specifier): Likewise.
	(cp_parser_qualified_namespace_specifier): Likewise.
	(cp_parser_using_declaration): Likewise.
	(cp_parser_using_directive): Likewise.
	(cp_parser_ptr_operator): Likewise.
	(cp_parser_declarator_id): Likewise.
	(cp_parser_class_head): Likewise.
	(cp_parser_base_specifier): Likewise.
	(cp_parser_constructor_declarator_p): Likewise.
	(cp_parser_direct_declarator): Fix typo in comment.
	(cp_parser_parenthesized_expression_list): Adjust call to
	cp_parser_skip_to_closing_parenthesis.
	(cp_parser_selection_statement): Likewise.

From-SVN: r74087
parent 8786882b
2003-11-30 Mark Mitchell <mark@codesourcery.com>
PR c++/9849
* parser.c (cp_lexer_prev_token): New function.
(cp_parser_skip_to_closing_parenthesis): Add consume_paren
parameter.
(cp_parser_nested_name_specifier_opt): Add is_declaration
parameter.
(cp_parser_nested_name_specifier): Likewise.
(cp_parser_class_or_namespace_name): Likewise.
(cp_parser_class_name): Likewise.
(cp_parser_template_id): Likewise.
(cp_parser_template_name): Likewise.
(cp_parser_id_expression): Adjust calls to
cp_parser_nested_name_specifier_op, cp_parser_template_id,
cp_parser_class_name.
(cp_parser_unqualified_id): Likewise.
(cp_parser_postfix_expression): Likewise.
(cp_parser_pseudo_destructor_name): Likewise.
(cp_parser_cast_expression): Likewise.
(cp_parser_mem_initializer_id): Likewise.
(cp_parser_simple_type_specifier): Likewise.
(cp_parser_type_name): Likewise.
(cp_parser_elaborated_type_specifier): Likewise.
(cp_parser_qualified_namespace_specifier): Likewise.
(cp_parser_using_declaration): Likewise.
(cp_parser_using_directive): Likewise.
(cp_parser_ptr_operator): Likewise.
(cp_parser_declarator_id): Likewise.
(cp_parser_class_head): Likewise.
(cp_parser_base_specifier): Likewise.
(cp_parser_constructor_declarator_p): Likewise.
(cp_parser_direct_declarator): Fix typo in comment.
(cp_parser_parenthesized_expression_list): Adjust call to
cp_parser_skip_to_closing_parenthesis.
(cp_parser_selection_statement): Likewise.
2003-11-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/12924
......
2003-11-30 Mark Mitchell <mark@codesourcery.com>
PR c++/9849
* g++.dg/template/error4.C: New test.
* g++.dg/template/nested3.C: Adjust error markers.
2003-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/cpp/assert4.c: Check more #system assertions.
......
template<class T> struct C1
{
template<class U> struct C2
{ class Type { }; };
};
template<class T, class U>
void foo(typename C1<T>::C2<U>::Type *) { } // { dg-error "template" }
......@@ -5,13 +5,13 @@ class A {
int _k;
};
T1 _t1;
T2 _t2;
T2 _t2; // { dg-error "instantiated" }
};
template <class U>
class B {
class B { // { dg-error "" }
class SubB1 {
B _i;
B _i; // { dg-error "" }
};
class SubB2 {
......@@ -22,7 +22,7 @@ class B {
int main() {
B<char> objB;
B<char> objB; // { dg-error "instantiated" }
return 0;
}
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