===================================================================
@@ -15137,7 +15137,9 @@ tsubst_copy_and_build (tree t,
case COND_EXPR:
{
- tree cond = RECUR (TREE_OPERAND (t, 0));
+ tree cond
+ = maybe_constant_value (fold_non_dependent_expr_sfinae
+ (RECUR (TREE_OPERAND (t, 0)), tf_none));
tree exp1, exp2;
if (TREE_CODE (cond) == INTEGER_CST)
===================================================================
@@ -0,0 +1,19 @@
+// PR c++/63265
+// { dg-do compile { target c++11 } }
+
+#define LSHIFT (sizeof(unsigned int) * __CHAR_BIT__)
+
+template <int lshift>
+struct SpuriouslyWarns1 {
+ static constexpr unsigned int v = lshift < LSHIFT ? 1U << lshift : 0;
+};
+
+static_assert(SpuriouslyWarns1<LSHIFT>::v == 0, "Impossible occurred");
+
+template <int lshift>
+struct SpuriouslyWarns2 {
+ static constexpr bool okay = lshift < LSHIFT;
+ static constexpr unsigned int v = okay ? 1U << lshift : 0;
+};
+
+static_assert(SpuriouslyWarns2<LSHIFT>::v == 0, "Impossible occurred");