+2018-04-11 Marek Polacek <polacek@redhat.com>
+
+ PR c++/85032
+ * constexpr.c (potential_constant_expression_1): Consider conversions
+ from classes to literal types potentially constant.
+
2018-04-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70808
TREE_TYPE (t));
return false;
}
+ /* This might be a conversion from a class to a (potentially) literal
+ type. Let's consider it potentially constant since the conversion
+ might be a constexpr user-defined conversion. */
+ else if (cxx_dialect >= cxx11
+ && (dependent_type_p (TREE_TYPE (t))
+ || !COMPLETE_TYPE_P (TREE_TYPE (t))
+ || literal_type_p (TREE_TYPE (t)))
+ && TREE_OPERAND (t, 0))
+ {
+ tree type = TREE_TYPE (TREE_OPERAND (t, 0));
+ /* If this is a dependent type, it could end up being a class
+ with conversions. */
+ if (type == NULL_TREE || WILDCARD_TYPE_P (type))
+ return true;
+ /* Or a non-dependent class which has conversions. */
+ else if (CLASS_TYPE_P (type)
+ && (TYPE_HAS_CONVERSION (type) || dependent_scope_p (type)))
+ return true;
+ }
return (RECUR (TREE_OPERAND (t, 0),
TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE));
+2018-04-11 Marek Polacek <polacek@redhat.com>
+
+ PR c++/85032
+ * g++.dg/cpp0x/pr51225.C: Adjust error message.
+ * g++.dg/cpp1z/constexpr-if21.C: New test.
+
2018-04-11 Jakub Jelinek <jakub@redhat.com>
PR target/85281
template<typename> void foo()
{
- A<int(x)> a; // { dg-error "not declared|invalid type" }
+ A<int(x)> a; // { dg-error "not declared|could not convert" }
}
template<typename> struct bar