* pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
the first operand.
From-SVN: r276699
+2019-10-08 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2019-09-15 Marek Polacek <polacek@redhat.com>
+
+ PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
+ * pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
+ the first operand.
+
2019-09-28 Marek Polacek <polacek@redhat.com>
Backported from mainline
if (TREE_CODE (expr) == COND_EXPR)
return build3 (COND_EXPR,
TREE_TYPE (expr),
- TREE_OPERAND (expr, 0),
+ build_non_dependent_expr (TREE_OPERAND (expr, 0)),
(TREE_OPERAND (expr, 1)
? build_non_dependent_expr (TREE_OPERAND (expr, 1))
: build_non_dependent_expr (TREE_OPERAND (expr, 0))),
--- /dev/null
+// PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
+// { dg-do compile { target c++14 } }
+
+constexpr bool f(const char*) { return true; }
+template<typename T> const char c = "FOO"[f("BAR") ? 1 : 0];