+2018-05-08 Marek Polacek <polacek@redhat.com>
+
+ PR c++/85695
+ * semantics.c (finish_if_stmt_cond): See through typedefs.
+
2018-05-07 Jason Merrill <jason@redhat.com>
PR c++/85646 - lambda visibility.
&& !instantiation_dependent_expression_p (cond)
/* Wait until instantiation time, since only then COND has been
converted to bool. */
- && TREE_TYPE (cond) == boolean_type_node)
+ && TYPE_MAIN_VARIANT (TREE_TYPE (cond)) == boolean_type_node)
{
cond = instantiate_non_dependent_expr (cond);
cond = cxx_constant_value (cond, NULL_TREE);
+2018-05-08 Marek Polacek <polacek@redhat.com>
+
+ PR c++/85695
+ * g++.dg/cpp1z/constexpr-if22.C: New test.
+
2018-05-08 Uros Bizjak <ubizjak@gmail.com>
PR target/85693
--- /dev/null
+// PR c++/85695
+// { dg-options -std=c++17 }
+
+template <typename T, T v>
+struct integral_constant {
+ using value_type = T;
+ static constexpr const value_type value = v;
+ constexpr operator value_type (void) const { return value; }
+};
+template <typename T> struct is_trivial
+ : public integral_constant<bool, __is_trivial(T)> {};
+
+template <typename T>
+T clone_object (const T& p)
+{
+ if constexpr (is_trivial<T>::value)
+ return p;
+ else
+ return p.clone();
+}
+int main (void) { return clone_object(0); }