From patchwork Fri Oct 15 17:15:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v3] Implement LWG 1240 Date: Fri, 15 Oct 2010 07:15:48 -0000 From: Paolo Carlini X-Patchwork-Id: 67984 Message-Id: <4CB88C44.1050506@oracle.com> To: "gcc-patches@gcc.gnu.org" Cc: libstdc++ Hi, tested x86_64-linux, committed. Paolo. ////////////////////// 2010-10-15 Paolo Carlini * include/std/functional (function<>::operator==, operator!=): Remove, per LWG 1240. * testsuite/20_util/function/cmp/cmp_neg.cc: Adjust dg-* directives. Index: include/std/functional =================================================================== --- include/std/functional (revision 165513) +++ include/std/functional (working copy) @@ -2096,12 +2096,6 @@ template const _Functor* target() const; #endif - // deleted overloads - template - void operator==(const function<_Res2(_ArgTypes2...)>&) const = delete; - template - void operator!=(const function<_Res2(_ArgTypes2...)>&) const = delete; - private: typedef _Res (*_Invoker_type)(const _Any_data&, _ArgTypes...); _Invoker_type _M_invoker; Index: testsuite/20_util/function/cmp/cmp_neg.cc =================================================================== --- testsuite/20_util/function/cmp/cmp_neg.cc (revision 165513) +++ testsuite/20_util/function/cmp/cmp_neg.cc (working copy) @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++0x" } // { dg-do compile } -// Copyright (C) 2009 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -26,13 +26,7 @@ { std::function f1; std::function f2; - f1 == f2; // { dg-error "deleted" } - f1 != f2; // { dg-error "deleted" } + f1 == f2; // { dg-error "no match" } + f1 != f2; // { dg-error "no match" } } - -int main() -{ - test01(); - - return 0; -} +// { dg-excess-errors "candidates are" }