diff options
author | Jason Merrill <jason@redhat.com> | 2019-11-05 18:50:08 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2019-11-05 18:50:08 -0500 |
commit | f22f817cbdffe5b4e7d0ba7ab0eeb56ee61b3b72 (patch) | |
tree | 297e198f67433c4deed3dde93c59355d41a91c01 /gcc/cp/cp-tree.h | |
parent | a81ffd93b83c4be250514ff385b5b88fa5c3835b (diff) | |
download | gcc-f22f817cbdffe5b4e7d0ba7ab0eeb56ee61b3b72.zip gcc-f22f817cbdffe5b4e7d0ba7ab0eeb56ee61b3b72.tar.gz gcc-f22f817cbdffe5b4e7d0ba7ab0eeb56ee61b3b72.tar.bz2 |
Various small C++ changes.
Wrappers for lookup_qualified_name and build_x_binary_op to make calling
them more convenient in places, and a function named contextual_conv_bool
for places that want contextual conversion to bool.
I noticed that we weren't showing the declaration location when we complain
about a call to a non-constexpr function where a constant expression is
required.
If maybe_instantiate_noexcept doesn't actually instantiate, there's no
reason for it to mess with clones.
* constexpr.c (explain_invalid_constexpr_fn): Show location of fn.
* pt.c (maybe_instantiate_noexcept): Only update clones if we
instantiated.
* typeck.c (contextual_conv_bool): New.
* name-lookup.c (lookup_qualified_name): Add wrapper overload taking
C string rather than identifier.
* parser.c (cp_parser_userdef_numeric_literal): Use it.
* rtti.c (emit_support_tinfos): Use it.
* cp-tree.h (ovl_op_identifier): Change to inline functions.
(build_x_binary_op): Add wrapper with fewer parms.
From-SVN: r277862
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 4b9aea6..58d7d01 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -270,9 +270,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; then deletes the entire object. */ #define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER] -#define ovl_op_identifier(ISASS, CODE) (OVL_OP_INFO(ISASS, CODE)->identifier) -#define assign_op_identifier (ovl_op_info[true][OVL_OP_NOP_EXPR].identifier) -#define call_op_identifier (ovl_op_info[false][OVL_OP_CALL_EXPR].identifier) /* The name used for conversion operators -- but note that actual conversion functions use special identifiers outside the identifier table. */ @@ -5816,6 +5813,12 @@ extern GTY(()) unsigned char ovl_op_alternate[OVL_OP_MAX]; #define IDENTIFIER_OVL_OP_FLAGS(NODE) \ (IDENTIFIER_OVL_OP_INFO (NODE)->flags) +inline tree ovl_op_identifier (bool isass, tree_code code) +{ return OVL_OP_INFO(isass, code)->identifier; } +inline tree ovl_op_identifier (tree_code code) { return ovl_op_identifier (false, code); } +#define assign_op_identifier (ovl_op_info[true][OVL_OP_NOP_EXPR].identifier) +#define call_op_identifier (ovl_op_info[false][OVL_OP_CALL_EXPR].identifier) + /* A type-qualifier, or bitmask therefore, using the TYPE_QUAL constants. */ @@ -7422,6 +7425,7 @@ enum compare_bounds_t { bounds_none, bounds_either, bounds_first }; extern bool cxx_mark_addressable (tree, bool = false); extern int string_conv_p (const_tree, const_tree, int); extern tree cp_truthvalue_conversion (tree); +extern tree contextual_conv_bool (tree, tsubst_flags_t); extern tree condition_conversion (tree); extern tree require_complete_type (tree); extern tree require_complete_type_sfinae (tree, tsubst_flags_t); @@ -7470,6 +7474,13 @@ extern tree build_x_binary_op (const op_location_t &, enum tree_code, tree, enum tree_code, tree *, tsubst_flags_t); +inline tree build_x_binary_op (const op_location_t &loc, + enum tree_code code, tree arg1, tree arg2, + tsubst_flags_t complain) +{ + return build_x_binary_op (loc, code, arg1, TREE_CODE (arg1), arg2, + TREE_CODE (arg2), NULL, complain); +} extern tree build_x_array_ref (location_t, tree, tree, tsubst_flags_t); extern tree build_x_unary_op (location_t, |