Commit 7efa3e22 by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/11050 ("some string" __FUNCTION__ is accepted)

cp:
	PR c++/11050
	* parser.c (cp_parser_expression_list): Rename to ...
	(cp_parser_parenthesized_expression_list): ... here. Add attribute
	parameter, parse the surounding parentheses.
	(cp_parser_skip_to_closing_parenthesis): Add recover and or_comma
	parameters. Return int.
	(cp_parser_skip_to_closing_parenthesis or comma): Remove.
	(cp_parser_postfix_expression): Adjust function call parsing.
	(cp_parser_new_placement): Adjust.
	(cp_parser_new_initializer): Likewise.
	(cp_parser_cast_expression): Likewise.
	(cp_parser_selection_statement): Likewise.
	(cp_parser_mem_initializer): Likewise.
	(cp_parser_asm_definition): Likewise.
	(cp_parser_init_declarator): Likewise.
	(cp_parser_declarator): Make
	cdtor_or_conv_p an int ptr.
	(cp_parser_direct_declarator): Likewise. Check for a parameter
	list on cdtors & conv functions.
	(cp_parser_initializer): Adjust.
	(cp_parser_member_declaration): Adjust.
	(cp_parser_attribute_list): Move code into
	cp_parser_parens_expression_list.
	(cp_parser_functional_cast): Adjust.
	* pt.c (type_dependent_expression_p): Erroneous expressions are
	non-dependent.
testsuite:
	PR c++/11050
	* g++.dg/parse/args1.C: New test.
	* g++.pt/defarg8.C: Change expected errors.

From-SVN: r69230
parent 87ca53f6
2003-07-11 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11050
* parser.c (cp_parser_expression_list): Rename to ...
(cp_parser_parenthesized_expression_list): ... here. Add attribute
parameter, parse the surounding parentheses.
(cp_parser_skip_to_closing_parenthesis): Add recover and or_comma
parameters. Return int.
(cp_parser_skip_to_closing_parenthesis or comma): Remove.
(cp_parser_postfix_expression): Adjust function call parsing.
(cp_parser_new_placement): Adjust.
(cp_parser_new_initializer): Likewise.
(cp_parser_cast_expression): Likewise.
(cp_parser_selection_statement): Likewise.
(cp_parser_mem_initializer): Likewise.
(cp_parser_asm_definition): Likewise.
(cp_parser_init_declarator): Likewise.
(cp_parser_declarator): Make
cdtor_or_conv_p an int ptr.
(cp_parser_direct_declarator): Likewise. Check for a parameter
list on cdtors & conv functions.
(cp_parser_initializer): Adjust.
(cp_parser_member_declaration): Adjust.
(cp_parser_attribute_list): Move code into
cp_parser_parens_expression_list.
(cp_parser_functional_cast): Adjust.
* pt.c (type_dependent_expression_p): Erroneous expressions are
non-dependent.
2003-07-11 Geoffrey Keating <geoffk@apple.com>
* decl.c (cp_finish_decl): Handle 'used' attribute.
......
......@@ -11567,6 +11567,9 @@ type_dependent_expression_p (tree expression)
if (!processing_template_decl)
return false;
if (expression == error_mark_node)
return false;
/* Some expression forms are never type-dependent. */
if (TREE_CODE (expression) == PSEUDO_DTOR_EXPR
|| TREE_CODE (expression) == SIZEOF_EXPR
......@@ -11675,7 +11678,9 @@ any_type_dependent_arguments_p (tree args)
{
while (args)
{
if (type_dependent_expression_p (TREE_VALUE (args)))
tree arg = TREE_VALUE (args);
if (type_dependent_expression_p (arg))
return true;
args = TREE_CHAIN (args);
}
......
2003-07-11 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11050
* g++.dg/parse/args1.C: New test.
* g++.pt/defarg8.C: Change expected errors.
2003-07-11 Mark Mitchell <mark@codesourcery.com>
PR c++/8164
......
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 9 Jul 2003 <nathan@codesourcery.com>
// PR c++ 11050. Accepted ill-formed
void Foo (int)
{
Foo(2 2); // { dg-error "expected" "" }
}
......@@ -3,6 +3,9 @@
// Default arguments containing more than one non-nested explicit
// template argument leads to parse error
// This might be ill formed. See DR 325 (which would like to make it
// so)
template <class T> class foo1;
template <class T, class U> class foo2;
......@@ -10,5 +13,5 @@ struct bar {
template <class T, class U>
bar(int i = foo1<T>::baz, // { dg-bogus "" "" { xfail *-*-* } } -
int j = int(foo2<T, U>::baz), // ok
int k = foo2<T, U>::baz) {} // { dg-bogus "" "" { xfail *-*-* } } - before > -
int k = foo2<T, U>::baz) {} // this is the problematic one.
};
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