From patchwork Sat Feb 12 21:28:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 82944 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 836F7B7123 for ; Sun, 13 Feb 2011 08:28:31 +1100 (EST) Received: (qmail 7556 invoked by alias); 12 Feb 2011 21:28:27 -0000 Received: (qmail 7540 invoked by uid 22791); 12 Feb 2011 21:28:26 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp206.alice.it (HELO smtp206.alice.it) (82.57.200.102) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 12 Feb 2011 21:28:21 +0000 Received: from [192.168.0.4] (79.53.234.148) by smtp206.alice.it (8.5.124.08) id 4D49918D00E7D785; Sat, 12 Feb 2011 22:28:17 +0100 Message-ID: <4D56FB71.80605@oracle.com> Date: Sat, 12 Feb 2011 22:28:17 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: [v3] libstdc++/47709 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, tested x86_64-linux, applied mainline and 4_5-branch. Paolo. ////////////////// 2011-02-12 Paolo Carlini PR libstdc++/47709 * include/ext/algorithm (is_heap): In C++0x mode import from namespace std. * testsuite/ext/is_heap/47709.cc: New. Index: include/ext/algorithm =================================================================== --- include/ext/algorithm (revision 170086) +++ include/ext/algorithm (working copy) @@ -1,6 +1,7 @@ // Algorithm extensions -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +// 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -426,6 +427,9 @@ __out_last - __out_first); } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + using std::is_heap; +#else /** * This is an SGI extension. * @ingroup SGIextensions @@ -465,6 +469,7 @@ return std::__is_heap(__first, __comp, __last - __first); } +#endif // is_sorted, a predicated testing whether a range is sorted in // nondescending order. This is an extension, not part of the C++ Index: testsuite/ext/is_heap/47709.cc =================================================================== --- testsuite/ext/is_heap/47709.cc (revision 0) +++ testsuite/ext/is_heap/47709.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2011 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +// libstdc++/47709 +void foo() +{ + std::vector v; + is_heap(v.begin(), v.end()); +}