From 39344c992725ed6535faae6414806afd6fc04189 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 31 Oct 2013 10:11:49 +0000 Subject: [PATCH] re PR c++/58581 ([c++11] ICE with no-throw specification in deleted function) /cp 2013-10-30 Paolo Carlini PR c++/58581 * call.c (build_over_call): Check return value of mark_used. /testsuite 2013-10-30 Paolo Carlini PR c++/58581 * g++.dg/cpp0x/deleted1.C: New. From-SVN: r204249 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/call.c | 5 +++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/deleted1.C | 6 ++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/deleted1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ba55d80..04dd264 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2013-10-30 Paolo Carlini + + PR c++/58581 + * call.c (build_over_call): Check return value of mark_used. + 2013-10-30 Jason Merrill * semantics.c (finish_compound_literal): Don't create a static variable diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 5663010..961ee2c 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -7112,8 +7112,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) 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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4c722e7..6819ed0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-10-30 Paolo Carlini + + PR c++/58581 + * g++.dg/cpp0x/deleted1.C: New. + 2013-10-31 Zhenqiang Chen * gcc.target/arm/lp1243022.c: New test. diff --git a/gcc/testsuite/g++.dg/cpp0x/deleted1.C b/gcc/testsuite/g++.dg/cpp0x/deleted1.C new file mode 100644 index 0000000..0a632bf --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/deleted1.C @@ -0,0 +1,6 @@ +// PR c++/58581 +// { dg-do compile { target c++11 } } + +template int foo(T) noexcept(T()) = delete; + +int i = foo(0); // { dg-error "deleted" } -- 2.7.4