aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2019-09-15 12:24:14 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2019-09-15 12:24:14 +0000
commitda903a1610ba94d9309ab3438bd8a6391a7e77fb (patch)
tree5d6145bb8f4865515e5f0bbadaddbc11587fc9ed /gcc/cp/cp-tree.h
parentf5b72b67cf7c667a1c21ffeee1a7e6716650c55d (diff)
downloadgcc-da903a1610ba94d9309ab3438bd8a6391a7e77fb.zip
gcc-da903a1610ba94d9309ab3438bd8a6391a7e77fb.tar.gz
gcc-da903a1610ba94d9309ab3438bd8a6391a7e77fb.tar.bz2
[C++ PATCH] simplify clone predicate
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00904.html * cp-tree.h (DECL_CLONED_FUNCTION_P): Reimplement using IDENTIFIER_CDTOR_P, correct documentation. (DECL_CLONED_FUNCTION): Directly access field. (decl_cloned_function_p): Delete. * class.c (decl_cloned_function_p): Delete. * pt.c (instantiate_template_1): Check DECL_CHAIN is a decl. From-SVN: r275727
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 793847d..6d217fc 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -2874,13 +2874,17 @@ struct GTY(()) lang_decl {
(DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (NODE) \
|| DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (NODE))
-/* Nonzero if NODE (a FUNCTION_DECL) is a cloned constructor or
+/* Nonzero if NODE (a _DECL) is a cloned constructor or
destructor. */
-#define DECL_CLONED_FUNCTION_P(NODE) (!!decl_cloned_function_p (NODE, true))
+#define DECL_CLONED_FUNCTION_P(NODE) \
+ (DECL_NAME (NODE) \
+ && IDENTIFIER_CDTOR_P (DECL_NAME (NODE)) \
+ && !DECL_MAYBE_IN_CHARGE_CDTOR_P (NODE))
/* If DECL_CLONED_FUNCTION_P holds, this is the function that was
cloned. */
-#define DECL_CLONED_FUNCTION(NODE) (*decl_cloned_function_p (NODE, false))
+#define DECL_CLONED_FUNCTION(NODE) \
+ (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->u.fn.u5.cloned_function)
/* Perform an action for each clone of FN, if FN is a function with
clones. This macro should be used like:
@@ -6333,7 +6337,6 @@ extern void check_abi_tags (tree);
extern tree missing_abi_tags (tree);
extern void fixup_type_variants (tree);
extern void fixup_attribute_variants (tree);
-extern tree* decl_cloned_function_p (const_tree, bool);
extern void clone_function_decl (tree, bool);
extern void adjust_clone_args (tree);
extern void deduce_noexcept_on_destructor (tree);