aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/expr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/expr.cc')
-rw-r--r--gcc/cp/expr.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/expr.cc b/gcc/cp/expr.cc
index 31fe098..56fc11f 100644
--- a/gcc/cp/expr.cc
+++ b/gcc/cp/expr.cc
@@ -397,6 +397,11 @@ fold_for_warn (tree x)
{
/* C++ implementation. */
+ if (cp_unevaluated_operand)
+ /* In an unevaluated context we don't care about the reduced value
+ of an expression, so neither should any warnings. */
+ return x;
+
/* Prevent warning-dependent constexpr evaluation from changing
DECL_UID (which breaks -fcompare-debug) and from instantiating
templates. */