+2011-07-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/49691
+ * parser.c (cp_parser_late_return_type_opt): Check quals parameter
+ rather than current_class_type to determine whether to set 'this'.
+ (cp_parser_direct_declarator): Pass -1 to quals if member_p is false.
+ (cp_parser_init_declarator): Pass down member_p.
+
2011-07-09 Jason Merrill <jason@redhat.com>
* tree.c (build_vec_init_elt): Strip TARGET_EXPR.
= cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED,
&ctor_dtor_or_conv_p,
/*parenthesized_p=*/NULL,
- /*member_p=*/false);
+ member_p);
/* Gather up the deferred checks. */
stop_deferring_access_checks ();
/* Parse the virt-specifier-seq. */
virt_specifiers = cp_parser_virt_specifier_seq_opt (parser);
- late_return
- = cp_parser_late_return_type_opt (parser, cv_quals);
+ late_return = (cp_parser_late_return_type_opt
+ (parser, member_p ? cv_quals : -1));
/* Create the function-declarator. */
declarator = make_call_declarator (declarator,
-> trailing-type-specifier-seq abstract-declarator(opt)
- Returns the type indicated by the type-id. */
+ Returns the type indicated by the type-id.
+
+ QUALS is either a bitmask of cv_qualifiers or -1 for a non-member
+ function. */
static tree
cp_parser_late_return_type_opt (cp_parser* parser, cp_cv_quals quals)
/* Consume the ->. */
cp_lexer_consume_token (parser->lexer);
- if (current_class_type)
+ if (quals >= 0)
{
/* DR 1207: 'this' is in scope in the trailing return type. */
tree this_parm = build_this_parm (current_class_type, quals);
+2011-07-09 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/regress/regress6.C: New.
+ * g++.dg/parse/crash45.C: Adjust message.
+ * g++.dg/template/crash38.C: Adjust message.
+ * g++.dg/template/crash64.C: Adjust message.
+
2011-07-09 H.J. Lu <hongjiu.lu@intel.com>
* c-c++-common/dfp/func-vararg-alternate-d128-2.c: Support x32.