+2018-06-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/85739 - ICE with pointer to member template parm.
+ * cvt.c (perform_qualification_conversions): Use cp_fold_convert.
+
2018-06-02 Jason Merrill <jason@redhat.com>
PR c++/85761 - ICE with ill-formed use of const outer variable.
/* Attempt to perform qualification conversions on EXPR to convert it
to TYPE. Return the resulting expression, or error_mark_node if
- the conversion was impossible. */
+ the conversion was impossible. Since this is only used by
+ convert_nontype_argument, we fold the conversion. */
tree
perform_qualification_conversions (tree type, tree expr)
if (same_type_p (type, expr_type))
return expr;
else if (can_convert_qual (type, expr))
- return build_nop (type, expr);
+ return cp_fold_convert (type, expr);
else
return error_mark_node;
}
--- /dev/null
+// PR c++/85739
+
+struct l { int k; };
+template <int l::*> class b { };
+template <const int l::*> class B { typedef int e; };
+template <int l::*i, const int l::*n>
+bool operator!=(B<n>, b<i>);
+
+bool bb = (B<&l::k>() != b<&l::k>());
+