aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-07-12 17:29:11 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-07-12 17:29:11 +0000
commit3da3dcdb98a750533a9d863fce8e30c657d968af (patch)
tree11091ea35eb14182aedb23929933dacdba16067c
parent1bde114aaceb7f423aaafbc62df6e5ba51a15b27 (diff)
downloadgcc-3da3dcdb98a750533a9d863fce8e30c657d968af.zip
gcc-3da3dcdb98a750533a9d863fce8e30c657d968af.tar.gz
gcc-3da3dcdb98a750533a9d863fce8e30c657d968af.tar.bz2
cp-tree.h (DECL_CONSTRUCTOR_P, [...]): Look at identifier flags.
* cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR, DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at identifier flags. * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and DECL_CXX_DESTRUCTOR explicitly. * decl2.c (grokclassfn): Likewise. * friend.c (do_friend): Likewise. * method.c (make_thunk, make_alias_for, implicitly_declare_fn): Likewise. From-SVN: r250158
-rw-r--r--gcc/cp/ChangeLog12
-rw-r--r--gcc/cp/cp-tree.h10
-rw-r--r--gcc/cp/decl.c4
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/friend.c2
-rw-r--r--gcc/cp/method.c12
6 files changed, 26 insertions, 16 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bf77412..178b262 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,15 @@
+2017-07-12 Nathan Sidwell <nathan@acm.org>
+
+ * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
+ DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
+ identifier flags.
+ * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
+ DECL_CXX_DESTRUCTOR explicitly.
+ * decl2.c (grokclassfn): Likewise.
+ * friend.c (do_friend): Likewise.
+ * method.c (make_thunk, make_alias_for,
+ implicitly_declare_fn): Likewise.
+
2017-07-11 Jason Merrill <jason@redhat.com>
Core DR 393
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index b58cfce..665ec03 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -2706,7 +2706,7 @@ struct GTY(()) lang_decl {
/* For FUNCTION_DECLs and TEMPLATE_DECLs: nonzero means that this function
is a constructor. */
#define DECL_CONSTRUCTOR_P(NODE) \
- DECL_CXX_CONSTRUCTOR_P (STRIP_TEMPLATE (NODE))
+ IDENTIFIER_CTOR_P (DECL_NAME (NODE))
/* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a complete
object. */
@@ -2722,8 +2722,7 @@ struct GTY(()) lang_decl {
specialized in-charge constructor or the specialized not-in-charge
constructor. */
#define DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P(NODE) \
- (DECL_DECLARES_FUNCTION_P (NODE) && DECL_CONSTRUCTOR_P (NODE) \
- && !DECL_CLONED_FUNCTION_P (NODE))
+ (DECL_NAME (NODE) == ctor_identifier)
/* Nonzero if NODE (a FUNCTION_DECL) is a copy constructor. */
#define DECL_COPY_CONSTRUCTOR_P(NODE) \
@@ -2736,14 +2735,13 @@ struct GTY(()) lang_decl {
/* Nonzero if NODE (a FUNCTION_DECL or TEMPLATE_DECL)
is a destructor. */
#define DECL_DESTRUCTOR_P(NODE) \
- DECL_CXX_DESTRUCTOR_P (STRIP_TEMPLATE (NODE))
+ IDENTIFIER_DTOR_P (DECL_NAME (NODE))
/* Nonzero if NODE (a FUNCTION_DECL) is a destructor, but not the
specialized in-charge constructor, in-charge deleting constructor,
or the base destructor. */
#define DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P(NODE) \
- (DECL_DECLARES_FUNCTION_P (NODE) && DECL_DESTRUCTOR_P (NODE) \
- && !DECL_CLONED_FUNCTION_P (NODE))
+ (DECL_NAME (NODE) == dtor_identifier)
/* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a complete
object. */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index b9b8794..5b8e6a2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8513,11 +8513,11 @@ grokfndecl (tree ctype,
case sfk_constructor:
case sfk_copy_constructor:
case sfk_move_constructor:
- DECL_CONSTRUCTOR_P (decl) = 1;
+ DECL_CXX_CONSTRUCTOR_P (decl) = 1;
DECL_NAME (decl) = ctor_identifier;
break;
case sfk_destructor:
- DECL_DESTRUCTOR_P (decl) = 1;
+ DECL_CXX_DESTRUCTOR_P (decl) = 1;
DECL_NAME (decl) = dtor_identifier;
break;
default:
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 62a50ac..4fa4ad9 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -342,7 +342,7 @@ grokclassfn (tree ctype, tree function, enum overload_flags flags)
DECL_CONTEXT (function) = ctype;
if (flags == DTOR_FLAG)
- DECL_DESTRUCTOR_P (function) = 1;
+ DECL_CXX_DESTRUCTOR_P (function) = 1;
if (flags == DTOR_FLAG || DECL_CONSTRUCTOR_P (function))
maybe_retrofit_in_chrg (function);
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index a3c2ed0..ef93bfe 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -529,7 +529,7 @@ do_friend (tree ctype, tree declarator, tree decl,
/* A method friend. */
if (flags == NO_SPECIAL && declarator == cname)
- DECL_CONSTRUCTOR_P (decl) = 1;
+ DECL_CXX_CONSTRUCTOR_P (decl) = 1;
grokclassfn (ctype, decl, flags);
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 0646b08..0a4a954 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -137,8 +137,8 @@ make_thunk (tree function, bool this_adjusting,
DECL_SAVED_FUNCTION_DATA (thunk) = NULL;
/* The thunk itself is not a constructor or destructor, even if
the thing it is thunking to is. */
- DECL_DESTRUCTOR_P (thunk) = 0;
- DECL_CONSTRUCTOR_P (thunk) = 0;
+ DECL_CXX_DESTRUCTOR_P (thunk) = 0;
+ DECL_CXX_CONSTRUCTOR_P (thunk) = 0;
DECL_EXTERNAL (thunk) = 1;
DECL_ARTIFICIAL (thunk) = 1;
/* The THUNK is not a pending inline, even if the FUNCTION is. */
@@ -223,8 +223,8 @@ make_alias_for (tree target, tree newid)
if (TREE_CODE (alias) == FUNCTION_DECL)
{
DECL_SAVED_FUNCTION_DATA (alias) = NULL;
- DECL_DESTRUCTOR_P (alias) = 0;
- DECL_CONSTRUCTOR_P (alias) = 0;
+ DECL_CXX_DESTRUCTOR_P (alias) = 0;
+ DECL_CXX_CONSTRUCTOR_P (alias) = 0;
DECL_PENDING_INLINE_P (alias) = 0;
DECL_DECLARED_INLINE_P (alias) = 0;
DECL_INITIAL (alias) = error_mark_node;
@@ -2058,9 +2058,9 @@ implicitly_declare_fn (special_function_kind kind, tree type,
/* Assignment operator. */
SET_OVERLOADED_OPERATOR_CODE (fn, NOP_EXPR);
else if (IDENTIFIER_CTOR_P (name))
- DECL_CONSTRUCTOR_P (fn) = true;
+ DECL_CXX_CONSTRUCTOR_P (fn) = true;
else
- DECL_DESTRUCTOR_P (fn) = true;
+ DECL_CXX_DESTRUCTOR_P (fn) = true;
SET_DECL_ALIGN (fn, MINIMUM_METHOD_BOUNDARY);