Hi,
to resolve this simple ICE we only have to check the return value of
mark_used, like we do in a number of other places. Tested x86_64-linux.
Thanks!
Paolo.
/////////////////////////
/cp
2013-10-30 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/58581
* call.c (build_over_call): Check return value of mark_used.
/testsuite
2013-10-30 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/58581
* g++.dg/cpp0x/deleted1.C: New.
Index: cp/call.c
===================================================================
--- cp/call.c (revision 204219)
+++ cp/call.c (working copy)
@@ -7112,8 +7112,9 @@ build_over_call (struct z_candidate *cand, int fla
mark_versions_used (fn);
}
- if (!already_used)
- mark_used (fn);
+ if (!already_used
+ && !mark_used (fn))
+ return error_mark_node;
if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0
/* Don't mess with virtual lookup in fold_non_dependent_expr; virtual
Index: testsuite/g++.dg/cpp0x/deleted1.C
===================================================================
--- testsuite/g++.dg/cpp0x/deleted1.C (revision 0)
+++ testsuite/g++.dg/cpp0x/deleted1.C (working copy)
@@ -0,0 +1,6 @@
+// PR c++/58581
+// { dg-do compile { target c++11 } }
+
+template<typename T> int foo(T) noexcept(T()) = delete;
+
+int i = foo(0); // { dg-error "deleted" }