break;
case TYPE_PACK_EXPANSION:
- return same_type_p (PACK_EXPANSION_PATTERN (t1),
- PACK_EXPANSION_PATTERN (t2));
+ return (same_type_p (PACK_EXPANSION_PATTERN (t1),
+ PACK_EXPANSION_PATTERN (t2))
+ && comp_template_args (PACK_EXPANSION_EXTRA_ARGS (t1),
+ PACK_EXPANSION_EXTRA_ARGS (t2)));
case DECLTYPE_TYPE:
if (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t1)
tree object_type;
tree member_scope;
tree result = NULL_TREE;
+ tree using_decl = NULL_TREE;
if (error_operand_p (object) || error_operand_p (member))
return error_mark_node;
result = build2 (COMPOUND_EXPR, TREE_TYPE (result),
object, result);
}
+ else if ((using_decl = strip_using_decl (member)) != member)
+ result = build_class_member_access_expr (object,
+ using_decl,
+ access_path, preserve_reference,
+ complain);
else
{
if (complain & tf_error)
return error_mark_node;
}
expr = lookup_member (dtor_type, complete_dtor_identifier,
- /*protect=*/1, /*want_type=*/false);
+ /*protect=*/1, /*want_type=*/false,
+ tf_warning_or_error);
expr = (adjust_result_of_qualified_name_lookup
(expr, dtor_type, object_type));
return expr;
{
/* Look up the member. */
member = lookup_member (access_path, name, /*protect=*/1,
- /*want_type=*/false);
+ /*want_type=*/false, complain);
if (member == NULL_TREE)
{
if (complain & tf_error)
ptrmem_type = TREE_TYPE (ptrmem);
gcc_assert (TYPE_PTRMEMFUNC_P (ptrmem_type));
member = lookup_member (ptrmem_type, member_name, /*protect=*/0,
- /*want_type=*/false);
+ /*want_type=*/false, tf_warning_or_error);
member_type = cp_build_qualified_type (TREE_TYPE (member),
cp_type_quals (ptrmem_type));
return fold_build3_loc (input_location,
bool *long_long_unsigned_p, bool *long_double_p)
{
tree argtypes = TYPE_ARG_TYPES (TREE_TYPE (decl));
- if (processing_template_decl)
- return (argtypes == NULL_TREE
- || same_type_p (TREE_VALUE (argtypes), void_type_node));
+ if (processing_template_decl || processing_specialization)
+ return argtypes == void_list_node;
else
{
tree argtype;
int arity;
int max_arity = 2;
- bool found_string_p = false;
- bool maybe_raw_p = false;
- bool found_size_p = false;
*long_long_unsigned_p = false;
*long_double_p = false;
if (TREE_CODE (t) == POINTER_TYPE)
{
+ bool maybe_raw_p = false;
t = TREE_TYPE (t);
if (cp_type_quals (t) != TYPE_QUAL_CONST)
return false;
t = TYPE_MAIN_VARIANT (t);
- if (same_type_p (t, char_type_node))
+ if ((maybe_raw_p = same_type_p (t, char_type_node))
+ || same_type_p (t, wchar_type_node)
+ || same_type_p (t, char16_type_node)
+ || same_type_p (t, char32_type_node))
{
- found_string_p = true;
- maybe_raw_p = true;
+ argtype = TREE_CHAIN (argtype);
+ if (!argtype)
+ return false;
+ t = TREE_VALUE (argtype);
+ if (maybe_raw_p && argtype == void_list_node)
+ return true;
+ else if (same_type_p (t, size_type_node))
+ {
+ ++arity;
+ continue;
+ }
+ else
+ return false;
}
- else if (same_type_p (t, wchar_type_node))
- found_string_p = true;
- else if (same_type_p (t, char16_type_node))
- found_string_p = true;
- else if (same_type_p (t, char32_type_node))
- found_string_p = true;
- else
- return false;
- }
- else if (same_type_p (t, size_type_node))
- {
- if (!found_string_p)
- return false;
- found_size_p = true;
}
else if (same_type_p (t, long_long_unsigned_type_node))
{
if (!argtype)
return false; /* Found ellipsis. */
- if (arity > max_arity)
- return false;
-
- if (found_string_p && !maybe_raw_p && !found_size_p)
+ if (arity != max_arity)
return false;
return true;