Commit 62b8a44e by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/9109 (parse ambiguity)

cp:
	PR c++/9109
	* parser.c (cp_parser_declarator_kind): New enum.
	(cp_parser_declarator): Adjust.
	(cp_parser_direct_declarator): Adjust. Allow for either named or
	abstract declarator. Prefer abstract, if possible. Allow
	parenthesized function name.
	(cp_parser_condition): Adjust cp_parser_declarator call.
	(cp_parser_explicit_instantiation): Likewise.
	(cp_parser_init_declarator): Likewise.
	(cp_parser_type_id): Likewise.
	(cp_parser_function_definition): Likewise.
	(cp_parser_member_declaration): Likewise.
	(cp_parser_parameter_declaration): Use cp_parser_declarator to do
	the tentative parsing.
	(cp_parser_exception_declaration): Likewise.
testsuite:
	* g++.dg/parse/ambig1.C: New test.
	* g++.dg/parse/defarg2.C: New test.

From-SVN: r60944
parent e914a571
2003-01-06 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9109
* parser.c (cp_parser_declarator_kind): New enum.
(cp_parser_declarator): Adjust.
(cp_parser_direct_declarator): Adjust. Allow for either named or
abstract declarator. Prefer abstract, if possible. Allow
parenthesized function name.
(cp_parser_condition): Adjust cp_parser_declarator call.
(cp_parser_explicit_instantiation): Likewise.
(cp_parser_init_declarator): Likewise.
(cp_parser_type_id): Likewise.
(cp_parser_function_definition): Likewise.
(cp_parser_member_declaration): Likewise.
(cp_parser_parameter_declaration): Use cp_parser_declarator to do
the tentative parsing.
(cp_parser_exception_declaration): Likewise.
2003-01-05 Mark Mitchell <mark@codesourcery.com>
* parser.c (cp_parser_template_parameter): Adjust call to
......
2003-01-06 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/parse/ambig1.C: New test.
* g++.dg/parse/defarg2.C: New test.
2003-01-05 Mark Mitchell <mark@codesourcery.com>
* g++.dg/template/defarg-1.C: New test.
......
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 Jan 2003 <nathan@codesourcery.com>
// PR 9109. Ambiguity. [dcl.ambig.res]/7
template <typename T> void Foo (int (T))
{
try {}
catch (int (T)) {}
}
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 Jan 2003 <nathan@codesourcery.com>
// We erroneously prohibited default args on parenthesized function
// declarations.
void (foo)(int i = 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