diff mbox

[C++] PR 58581

Message ID 52715871.8080807@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Oct. 30, 2013, 7:05 p.m. UTC
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.carlini@oracle.com>

	PR c++/58581
	* call.c (build_over_call): Check return value of mark_used.

/testsuite
2013-10-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58581
	* g++.dg/cpp0x/deleted1.C: New.

Comments

Jason Merrill Oct. 30, 2013, 7:32 p.m. UTC | #1
OK.

Jason
diff mbox

Patch

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" }