aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2018-02-08 18:56:17 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2018-02-08 18:56:17 +0000
commita7f8415c05fa2ba336a071c211f09c0e76f2bb0a (patch)
tree8305a011127fc413b8af099dc8d73a9a11ae152a /gcc
parent739745618a4202f3bf515494175eacae6ff05d2d (diff)
downloadgcc-a7f8415c05fa2ba336a071c211f09c0e76f2bb0a.zip
gcc-a7f8415c05fa2ba336a071c211f09c0e76f2bb0a.tar.gz
gcc-a7f8415c05fa2ba336a071c211f09c0e76f2bb0a.tar.bz2
constexpr.c (cxx_eval_component_reference): Use INDIRECT_REF_P.
2018-02-08 Paolo Carlini <paolo.carlini@oracle.com> * constexpr.c (cxx_eval_component_reference): Use INDIRECT_REF_P. * lambda.c (build_capture_proxy): Likewise. * search.c (field_access_p): Likewise. * semantics.c (omp_clause_decl, omp_privatize_field, finish_omp_clauses): Likewise. From-SVN: r257503
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/constexpr.c2
-rw-r--r--gcc/cp/lambda.c2
-rw-r--r--gcc/cp/search.c2
-rw-r--r--gcc/cp/semantics.c6
5 files changed, 14 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c68b590..be4db4b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,13 @@
2018-02-08 Paolo Carlini <paolo.carlini@oracle.com>
+ * constexpr.c (cxx_eval_component_reference): Use INDIRECT_REF_P.
+ * lambda.c (build_capture_proxy): Likewise.
+ * search.c (field_access_p): Likewise.
+ * semantics.c (omp_clause_decl, omp_privatize_field,
+ finish_omp_clauses): Likewise.
+
+2018-02-08 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/83806
* typeck.c (decay_conversion): Use mark_rvalue_use for the special
case of nullptr too.
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 93dd8ae..39a2e1a 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -2463,7 +2463,7 @@ cxx_eval_component_reference (const constexpr_ctx *ctx, tree t,
tree whole = cxx_eval_constant_expression (ctx, orig_whole,
lval,
non_constant_p, overflow_p);
- if (TREE_CODE (whole) == INDIRECT_REF
+ if (INDIRECT_REF_P (whole)
&& integer_zerop (TREE_OPERAND (whole, 0))
&& !ctx->quiet)
error ("dereferencing a null pointer in %qE", orig_whole);
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index ff8236a..2545eae 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -450,7 +450,7 @@ build_capture_proxy (tree member, tree init)
{
if (PACK_EXPANSION_P (init))
init = PACK_EXPANSION_PATTERN (init);
- if (TREE_CODE (init) == INDIRECT_REF)
+ if (INDIRECT_REF_P (init))
init = TREE_OPERAND (init, 0);
STRIP_NOPS (init);
}
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 920fc15..796209f 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1636,7 +1636,7 @@ field_access_p (tree component_ref, tree field_decl, tree field_type)
return false;
tree indirect_ref = TREE_OPERAND (component_ref, 0);
- if (TREE_CODE (indirect_ref) != INDIRECT_REF)
+ if (!INDIRECT_REF_P (indirect_ref))
return false;
tree ptr = STRIP_NOPS (TREE_OPERAND (indirect_ref, 0));
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ea92da3..f0cee68 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4391,7 +4391,7 @@ omp_clause_decl_field (tree decl)
&& DECL_OMP_PRIVATIZED_MEMBER (decl))
{
tree f = DECL_VALUE_EXPR (decl);
- if (TREE_CODE (f) == INDIRECT_REF)
+ if (INDIRECT_REF_P (f))
f = TREE_OPERAND (f, 0);
if (TREE_CODE (f) == COMPONENT_REF)
{
@@ -4446,7 +4446,7 @@ omp_privatize_field (tree t, bool shared)
omp_private_member_map = new hash_map<tree, tree>;
if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE)
{
- gcc_assert (TREE_CODE (m) == INDIRECT_REF);
+ gcc_assert (INDIRECT_REF_P (m));
m = TREE_OPERAND (m, 0);
}
tree vb = NULL_TREE;
@@ -5864,7 +5864,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
if (TREE_CODE (t) == POINTER_PLUS_EXPR)
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == ADDR_EXPR
- || TREE_CODE (t) == INDIRECT_REF)
+ || INDIRECT_REF_P (t))
t = TREE_OPERAND (t, 0);
}
tree n = omp_clause_decl_field (t);