/* C++ Parser.
Copyright (C) 2000, 2001, 2002, 2003, 2004,
- 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ 2005, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>.
This file is part of GCC.
TREE_TYPE (tparm))))
found = false;
}
- if (found)
+ if (found
+ && ix == VEC_length (tree, args)
+ /* May be this should be sufficient_parms_p instead,
+ depending on how exactly should user-defined literals
+ work in presence of default arguments on the literal
+ operator parameters. */
+ && argtypes == void_list_node)
return fn;
}
}
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
}
- if (scope && name && BASELINK_P (name))
+ if (parser->scope && name && BASELINK_P (name))
adjust_result_of_qualified_name_lookup
- (name, BINFO_TYPE (BASELINK_ACCESS_BINFO (name)), scope);
+ (name, parser->scope, scope);
postfix_expression
= finish_class_member_access_expr (postfix_expression, name,
template_p,
lhs = cp_parser_cast_expression (parser, /*address_p=*/false, cast_p, pidk);
lhs_type = ERROR_MARK;
+ if (cp_parser_error_occurred (parser))
+ return error_mark_node;
+
for (;;)
{
/* Get an operator token. */
its name; we will look it up again during template instantiation. */
if (DECL_FUNCTION_TEMPLATE_P (decl) || !DECL_P (decl))
{
- tree scope = CP_DECL_CONTEXT (get_first_fn (decl));
+ tree scope = ovl_scope (decl);
if (TYPE_P (scope) && dependent_type_p (scope))
return identifier;
}
{
/* We want to record the extra mangling scope for in-class
initializers of class members and initializers of static data
- member templates. The former is a C++0x feature which isn't
- implemented yet, and I expect it will involve deferring
+ member templates. The former involves deferring
parsing of the initializer until end of class as with default
arguments. So right here we only handle the latter. */
if (!member_p && processing_template_decl)
cp_parser_function_body changed its state. */
if (check_body_p)
{
- list = body;
- if (TREE_CODE (list) == BIND_EXPR)
- list = BIND_EXPR_BODY (list);
- if (TREE_CODE (list) == STATEMENT_LIST
- && STATEMENT_LIST_TAIL (list) != NULL)
+ list = cur_stmt_list;
+ if (STATEMENT_LIST_TAIL (list))
last = STATEMENT_LIST_TAIL (list)->stmt;
}
/* Parse the function-body. */
decl = TYPE_NAME (decl);
}
+ decl = strip_using_decl (decl);
+
/* Check to see that it is really the name of a class. */
if (TREE_CODE (decl) == TEMPLATE_ID_EXPR
&& TREE_CODE (TREE_OPERAND (decl, 0)) == IDENTIFIER_NODE
possible that this fact is an oversight in the
standard, since a pure function may be defined
outside of the class-specifier. */
- if (initializer)
+ if (initializer && initializer_token_start)
error_at (initializer_token_start->location,
"pure-specifier on function-definition");
decl = cp_parser_save_member_function_body (parser,