diff options
author | Martin Liska <mliska@suse.cz> | 2022-10-15 15:32:39 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-10-15 15:32:39 +0200 |
commit | 2c92cfe87d2bb8aa0eb78f3932fca16699cb35c9 (patch) | |
tree | b118381a0a883a762ddd56c0e91608d937ee8bdf /gcc/cp/constexpr.cc | |
parent | bd21c04269deded2c7476ceca1100a26f28ea526 (diff) | |
parent | baeec7cc83b19b46d1c73523f06efa7ea2b30390 (diff) | |
download | gcc-2c92cfe87d2bb8aa0eb78f3932fca16699cb35c9.zip gcc-2c92cfe87d2bb8aa0eb78f3932fca16699cb35c9.tar.gz gcc-2c92cfe87d2bb8aa0eb78f3932fca16699cb35c9.tar.bz2 |
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/cp/constexpr.cc')
-rw-r--r-- | gcc/cp/constexpr.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index 2038f43..0366396 100644 --- a/gcc/cp/constexpr.cc +++ b/gcc/cp/constexpr.cc @@ -2088,7 +2088,7 @@ cxx_dynamic_cast_fn_p (tree fndecl) { return (cxx_dialect >= cxx20 && id_equal (DECL_NAME (fndecl), "__dynamic_cast") - && CP_DECL_CONTEXT (fndecl) == global_namespace); + && CP_DECL_CONTEXT (fndecl) == abi_node); } /* Often, we have an expression in the form of address + offset, e.g. @@ -7598,6 +7598,19 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, } break; + case EXCESS_PRECISION_EXPR: + { + tree oldop = TREE_OPERAND (t, 0); + + tree op = cxx_eval_constant_expression (ctx, oldop, + lval, + non_constant_p, overflow_p); + if (*non_constant_p) + return t; + r = fold_convert (TREE_TYPE (t), op); + break; + } + case EMPTY_CLASS_EXPR: /* Handle EMPTY_CLASS_EXPR produced by build_call_a by lowering it to an appropriate CONSTRUCTOR. */ @@ -8898,6 +8911,9 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, sub-object of such an object; */ return RECUR (TREE_OPERAND (t, 0), rval); + case EXCESS_PRECISION_EXPR: + return RECUR (TREE_OPERAND (t, 0), rval); + case VAR_DECL: if (DECL_HAS_VALUE_EXPR_P (t)) { |