aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6/gcc/cp/parser.c
diff options
context:
space:
mode:
authorJing Yu <jingyu@google.com>2012-02-15 15:40:16 -0800
committerJing Yu <jingyu@google.com>2012-02-15 15:40:16 -0800
commit3f73d6ef90458b45bbbb33ef4c2b174d4662a22d (patch)
tree1b5f0d96c51b51168b3713058a1b62e92f1136eb /gcc-4.6/gcc/cp/parser.c
parentd7030123e04baab5dbff9c9ee04c0de99bd9a774 (diff)
downloadtoolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.tar.gz
toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.tar.bz2
toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.zip
Sync down FSF r184235@google/gcc-4_6_2-mobile branch
1) Get mostly new patches from FSF gcc-4.6 branch 2) Fix PR52129 3) Insert GNU-stack note for all ARM targets Change-Id: I2b9926981210e517e4021242908074319a91d6bd
Diffstat (limited to 'gcc-4.6/gcc/cp/parser.c')
-rw-r--r--gcc-4.6/gcc/cp/parser.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/gcc-4.6/gcc/cp/parser.c b/gcc-4.6/gcc/cp/parser.c
index f5eb09966..12cfacf38 100644
--- a/gcc-4.6/gcc/cp/parser.c
+++ b/gcc-4.6/gcc/cp/parser.c
@@ -2759,8 +2759,8 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser,
The user should have said "typename A<T>::X". */
if (cxx_dialect < cxx0x && id == ridpointers[(int)RID_CONSTEXPR])
- inform (location, "C++0x %<constexpr%> only available with "
- "-std=c++0x or -std=gnu++0x");
+ inform (location, "C++11 %<constexpr%> only available with "
+ "-std=c++11 or -std=gnu++11");
else if (processing_template_decl && current_class_type
&& TYPE_BINFO (current_class_type))
{
@@ -8049,8 +8049,11 @@ static void
cp_parser_lambda_body (cp_parser* parser, tree lambda_expr)
{
bool nested = (current_function_decl != NULL_TREE);
+ bool local_variables_forbidden_p = parser->local_variables_forbidden_p;
if (nested)
push_function_context ();
+ /* Clear this in case we're in the middle of a default argument. */
+ parser->local_variables_forbidden_p = false;
/* Finish the function call operator
- class_specifier
@@ -8137,6 +8140,7 @@ cp_parser_lambda_body (cp_parser* parser, tree lambda_expr)
expand_or_defer_fn (finish_function (/*inline*/2));
}
+ parser->local_variables_forbidden_p = local_variables_forbidden_p;
if (nested)
pop_function_context();
}
@@ -16708,16 +16712,6 @@ cp_parser_initializer_clause (cp_parser* parser, bool* non_constant_p)
= cp_parser_constant_expression (parser,
/*allow_non_constant_p=*/true,
non_constant_p);
- if (!*non_constant_p)
- {
- /* We only want to fold if this is really a constant
- expression. FIXME Actually, we don't want to fold here, but in
- cp_finish_decl. */
- tree folded = fold_non_dependent_expr (initializer);
- folded = maybe_constant_value (folded);
- if (TREE_CONSTANT (folded))
- initializer = folded;
- }
}
else
initializer = cp_parser_braced_list (parser, non_constant_p);
@@ -19275,6 +19269,7 @@ cp_parser_late_parsing_attribute_arg_lists (cp_parser* parser)
cp_token_cache *tokens = (cp_token_cache *) TREE_VALUE (artificial_node);
tree ctype;
VEC(tree,gc) *vec;
+ tree clone;
gcc_assert (tokens);
gcc_assert (decl && decl != error_mark_node);
@@ -19318,16 +19313,9 @@ cp_parser_late_parsing_attribute_arg_lists (cp_parser* parser)
/* If decl has clones (when it is a ctor or a dtor), we need to
modify the clones' attributes as well. */
- if (TREE_CODE (decl) == FUNCTION_DECL
- && (DECL_CONSTRUCTOR_P (decl) || DECL_DESTRUCTOR_P (decl)))
- {
- tree clone;
- for (clone = TREE_CHAIN (decl); clone; clone = TREE_CHAIN (clone))
- {
- if (DECL_CLONED_FUNCTION (clone) == decl)
- DECL_ATTRIBUTES (clone) = DECL_ATTRIBUTES (decl);
- }
- }
+ FOR_EACH_CLONE (clone, decl)
+ if (DECL_CLONED_FUNCTION (clone) == decl)
+ DECL_ATTRIBUTES (clone) = DECL_ATTRIBUTES (decl);
pop_nested_class ();
@@ -23530,7 +23518,7 @@ cp_parser_objc_at_property_declaration (cp_parser *parser)
break;
}
cp_lexer_consume_token (parser->lexer); /* eat the = */
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_NAME))
+ if (!cp_parser_objc_selector_p (cp_lexer_peek_token (parser->lexer)->type))
{
cp_parser_error (parser, "expected identifier");
syntax_error = true;
@@ -23539,10 +23527,12 @@ cp_parser_objc_at_property_declaration (cp_parser *parser)
if (keyword == RID_SETTER)
{
if (property_setter_ident != NULL_TREE)
- cp_parser_error (parser, "the %<setter%> attribute may only be specified once");
+ {
+ cp_parser_error (parser, "the %<setter%> attribute may only be specified once");
+ cp_lexer_consume_token (parser->lexer);
+ }
else
- property_setter_ident = cp_lexer_peek_token (parser->lexer)->u.value;
- cp_lexer_consume_token (parser->lexer);
+ property_setter_ident = cp_parser_objc_selector (parser);
if (cp_lexer_next_token_is_not (parser->lexer, CPP_COLON))
cp_parser_error (parser, "setter name must terminate with %<:%>");
else
@@ -23551,10 +23541,12 @@ cp_parser_objc_at_property_declaration (cp_parser *parser)
else
{
if (property_getter_ident != NULL_TREE)
- cp_parser_error (parser, "the %<getter%> attribute may only be specified once");
+ {
+ cp_parser_error (parser, "the %<getter%> attribute may only be specified once");
+ cp_lexer_consume_token (parser->lexer);
+ }
else
- property_getter_ident = cp_lexer_peek_token (parser->lexer)->u.value;
- cp_lexer_consume_token (parser->lexer);
+ property_getter_ident = cp_parser_objc_selector (parser);
}
break;
default: