* cvt.c (cp_fold_convert): Handle PMF CONSTRUCTORs directly.
From-SVN: r259689
+2018-04-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/85545 - ICE with noexcept PMF conversion.
+ * cvt.c (cp_fold_convert): Handle PMF CONSTRUCTORs directly.
+
2018-04-25 Nathan Sidwell <nathan@acm.org>
PR c++/85437
tree conv;
if (TREE_TYPE (expr) == type)
conv = expr;
- else if (TREE_CODE (expr) == PTRMEM_CST)
+ else if (TREE_CODE (expr) == PTRMEM_CST
+ || (TREE_CODE (expr) == CONSTRUCTOR
+ && TYPE_PTRMEMFUNC_P (type)))
{
/* Avoid wrapping a PTRMEM_CST in NOP_EXPR. */
conv = copy_node (expr);
--- /dev/null
+// PR c++/85545
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+ void foo() noexcept;
+};
+
+template<typename T> void bar(T);
+
+void baz()
+{
+ bar(static_cast<void(A::*)()>(&A::foo));
+}