diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-24 16:04:01 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-24 16:04:01 +0000 |
commit | acd271749c6163b3e1654e6a8f907b4ede361438 (patch) | |
tree | 4162746b9bc8ce44af52f51250d517ce50e09dc2 /gcc/cp/init.c | |
parent | edf212c67d6413653d7a9034db94949ffa46e8a8 (diff) | |
download | gcc-acd271749c6163b3e1654e6a8f907b4ede361438.tar.gz |
* cxx-pretty-print.c (pp_cxx_check_constraint): Use VAR_P (x)
instead of TREE_CODE (x) == VAR_DECL.
* constraint.cc (get_concept_definition): Likewise.
(finish_shorthand_constraint): Likewise.
* init.c (warn_placement_new_too_small): Likewise.
* cp-gimplify.c (cp_genericize_r): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241480 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r-- | gcc/cp/init.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 455995a58d7..2418a9d48c1 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2362,7 +2362,7 @@ warn_placement_new_too_small (tree type, tree nelts, tree size, tree oper) to placement new is not checked since it's unknown what it might point to. */ if (TREE_CODE (oper) == PARM_DECL - || TREE_CODE (oper) == VAR_DECL + || VAR_P (oper) || TREE_CODE (oper) == COMPONENT_REF) return; @@ -2435,13 +2435,13 @@ warn_placement_new_too_small (tree type, tree nelts, tree size, tree oper) { tree op0 = oper; while (TREE_CODE (op0 = TREE_OPERAND (op0, 0)) == COMPONENT_REF); - if (TREE_CODE (op0) == VAR_DECL) + if (VAR_P (op0)) var_decl = op0; oper = TREE_OPERAND (oper, 1); } if ((addr_expr || !POINTER_TYPE_P (TREE_TYPE (oper))) - && (TREE_CODE (oper) == VAR_DECL + && (VAR_P (oper) || TREE_CODE (oper) == FIELD_DECL || TREE_CODE (oper) == PARM_DECL)) { @@ -2455,7 +2455,7 @@ warn_placement_new_too_small (tree type, tree nelts, tree size, tree oper) /* Treat members of unions and members of structs uniformly, even though the size of a member of a union may be viewed as extending to the end of the union itself (it is by __builtin_object_size). */ - if ((TREE_CODE (oper) == VAR_DECL || use_obj_size) + if ((VAR_P (oper) || use_obj_size) && DECL_SIZE_UNIT (oper) && tree_fits_uhwi_p (DECL_SIZE_UNIT (oper))) { |