+2019-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88977
+ * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
+ to maybe_constant_value calls.
+
2019-02-11 Marek Polacek <polacek@redhat.com>
* typeck2.c (digest_init_r): Remove commented code.
/* Make sure we return NULL_TREE only if we have really issued
an error, as described above. */
return (complain & tf_error) ? NULL_TREE : error_mark_node;
- expr = maybe_constant_value (expr);
+ expr = maybe_constant_value (expr, NULL_TREE,
+ /*manifestly_const_eval=*/true);
expr = convert_from_reference (expr);
}
else if (TYPE_PTR_OR_PTRMEM_P (type))
{
- tree folded = maybe_constant_value (expr);
+ tree folded = maybe_constant_value (expr, NULL_TREE,
+ /*manifestly_const_eval=*/true);
if (TYPE_PTR_P (type) ? integer_zerop (folded)
: null_member_pointer_value_p (folded))
expr = folded;
+2019-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88977
+ * g++.dg/cpp2a/is-constant-evaluated7.C: New test.
+
2019-02-12 Wilco Dijkstra <wdijkstr@arm.com>
PR tree-optimization/86637
--- /dev/null
+// P0595R2
+// PR c++/88977
+// { dg-do compile { target c++11 } }
+
+namespace std {
+ constexpr inline bool
+ is_constant_evaluated () noexcept
+ {
+ return __builtin_is_constant_evaluated ();
+ }
+}
+
+template<bool B> constexpr bool foo () { return B; }
+
+constexpr bool x = foo<std::is_constant_evaluated ()> ();
+constexpr bool y = foo<__builtin_is_constant_evaluated ()> ();
+static_assert (x, "");
+static_assert (y, "");