Commit ba05366b by Paolo Carlini Committed by Paolo Carlini

pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.

2017-10-27  Paolo Carlini  <paolo.carlini@oracle.com>

	* pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.

From-SVN: r254158
parent 6c6bde30
2017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
* pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
2017-10-26 Nathan Sidwell <nathan@acm.org> 2017-10-26 Nathan Sidwell <nathan@acm.org>
* decl.c (sort_labels): Restore function. * decl.c (sort_labels): Restore function.
......
...@@ -203,7 +203,7 @@ static void tsubst_default_arguments (tree, tsubst_flags_t); ...@@ -203,7 +203,7 @@ static void tsubst_default_arguments (tree, tsubst_flags_t);
static tree for_each_template_parm_r (tree *, int *, void *); static tree for_each_template_parm_r (tree *, int *, void *);
static tree copy_default_args_to_explicit_spec_1 (tree, tree); static tree copy_default_args_to_explicit_spec_1 (tree, tree);
static void copy_default_args_to_explicit_spec (tree); static void copy_default_args_to_explicit_spec (tree);
static int invalid_nontype_parm_type_p (tree, tsubst_flags_t); static bool invalid_nontype_parm_type_p (tree, tsubst_flags_t);
static bool dependent_template_arg_p (tree); static bool dependent_template_arg_p (tree);
static bool any_template_arguments_need_structural_equality_p (tree); static bool any_template_arguments_need_structural_equality_p (tree);
static bool dependent_type_p_r (tree); static bool dependent_type_p_r (tree);
...@@ -23618,31 +23618,31 @@ instantiating_current_function_p (void) ...@@ -23618,31 +23618,31 @@ instantiating_current_function_p (void)
} }
/* [temp.param] Check that template non-type parm TYPE is of an allowable /* [temp.param] Check that template non-type parm TYPE is of an allowable
type. Return zero for ok, nonzero for disallowed. Issue error and type. Return false for ok, true for disallowed. Issue error and
warning messages under control of COMPLAIN. */ inform messages under control of COMPLAIN. */
static int static bool
invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain) invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
{ {
if (INTEGRAL_OR_ENUMERATION_TYPE_P (type)) if (INTEGRAL_OR_ENUMERATION_TYPE_P (type))
return 0; return false;
else if (POINTER_TYPE_P (type)) else if (POINTER_TYPE_P (type))
return 0; return false;
else if (TYPE_PTRMEM_P (type)) else if (TYPE_PTRMEM_P (type))
return 0; return false;
else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
return 0; return false;
else if (TREE_CODE (type) == TYPENAME_TYPE) else if (TREE_CODE (type) == TYPENAME_TYPE)
return 0; return false;
else if (TREE_CODE (type) == DECLTYPE_TYPE) else if (TREE_CODE (type) == DECLTYPE_TYPE)
return 0; return false;
else if (TREE_CODE (type) == NULLPTR_TYPE) else if (TREE_CODE (type) == NULLPTR_TYPE)
return 0; return false;
/* A bound template template parm could later be instantiated to have a valid /* A bound template template parm could later be instantiated to have a valid
nontype parm type via an alias template. */ nontype parm type via an alias template. */
else if (cxx_dialect >= cxx11 else if (cxx_dialect >= cxx11
&& TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM) && TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
return 0; return false;
if (complain & tf_error) if (complain & tf_error)
{ {
...@@ -23652,7 +23652,7 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain) ...@@ -23652,7 +23652,7 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
error ("%q#T is not a valid type for a template non-type parameter", error ("%q#T is not a valid type for a template non-type parameter",
type); type);
} }
return 1; return true;
} }
/* Returns TRUE if TYPE is dependent, in the sense of [temp.dep.type]. /* Returns TRUE if TYPE is dependent, in the sense of [temp.dep.type].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment