diff options
Diffstat (limited to 'gcc/cp/parser.cc')
-rw-r--r-- | gcc/cp/parser.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 4e3ed66..9ddfb02 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -5583,7 +5583,9 @@ cp_parser_primary_expression (cp_parser *parser, /* Floating-point literals are only allowed in an integral constant expression if they are cast to an integral or enumeration type. */ - if (TREE_CODE (token->u.value) == REAL_CST + if ((TREE_CODE (token->u.value) == REAL_CST + || (TREE_CODE (token->u.value) == EXCESS_PRECISION_EXPR + && TREE_CODE (TREE_OPERAND (token->u.value, 0)) == REAL_CST)) && parser->integral_constant_expression_p && pedantic) { @@ -11677,10 +11679,10 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr) declarator = make_call_declarator (declarator, param_list, quals, VIRT_SPEC_UNSPECIFIED, - REF_QUAL_NONE, + REF_QUAL_NONE, tx_qual, exception_spec, - return_type, + return_type, trailing_requires_clause, UNKNOWN_LOCATION); declarator->std_attributes = std_attrs; @@ -25410,6 +25412,7 @@ cp_parser_skip_to_closing_square_bracket (cp_parser *parser) if (!parser->lexer->in_pragma) break; /* FALLTHRU */ + case CPP_EOF: /* If we've run out of tokens, then there is no closing `]'. */ return false; @@ -27490,6 +27493,7 @@ cp_parser_member_declaration (cp_parser* parser) &decl_specifiers, declarator, attributes); + if (parser->fully_implicit_function_template_p) decl = finish_fully_implicit_template (parser, decl); /* If the member was not a friend, declare it here. */ @@ -27513,6 +27517,7 @@ cp_parser_member_declaration (cp_parser* parser) else if (declarator->kind == cdk_function) declarator->id_loc = token->location; + /* Create the declaration. */ decl = grokfield (declarator, &decl_specifiers, initializer, /*init_const_expr_p=*/true, @@ -29107,6 +29112,7 @@ cp_parser_std_attribute (cp_parser *parser, tree attr_ns) attr_id = canonicalize_attr_name (attr_id); attribute = build_tree_list (build_tree_list (NULL_TREE, attr_id), NULL_TREE); + /* We used to treat C++11 noreturn attribute as equivalent to GNU's, but no longer: we have to be able to tell [[noreturn]] and __attribute__((noreturn)) apart. */ @@ -29437,8 +29443,7 @@ cp_parser_std_attribute_spec (cp_parser *parser) /* Parse a standard C++-11 attribute-specifier-seq. attribute-specifier-seq: - attribute-specifier-seq [opt] attribute-specifier - */ + attribute-specifier-seq [opt] attribute-specifier */ static tree cp_parser_std_attribute_spec_seq (cp_parser *parser) @@ -31393,6 +31398,7 @@ cp_parser_function_definition_after_declarator (cp_parser* parser, /* Generate code for it, if necessary. */ expand_or_defer_fn (fn); + /* Restore the saved values. */ parser->in_unbraced_linkage_specification_p = saved_in_unbraced_linkage_specification_p; |