From 8d01b8bafb4f34db90c619eee05849c4ccecab10 Mon Sep 17 00:00:00 2001 From: paolo Date: Sat, 12 Feb 2011 21:26:21 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170089 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/include/ext/algorithm | 7 ++++++- libstdc++-v3/testsuite/ext/is_heap/47709.cc | 29 +++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 libstdc++-v3/testsuite/ext/is_heap/47709.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f25b6cfaf7a..c67b5e41228 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +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. + 2011-02-12 Jakub Jelinek Jonathan Wakely diff --git a/libstdc++-v3/include/ext/algorithm b/libstdc++-v3/include/ext/algorithm index bfe454cecd4..368b5918058 100644 --- a/libstdc++-v3/include/ext/algorithm +++ b/libstdc++-v3/include/ext/algorithm @@ -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 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __out_last - __out_first); } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + using std::is_heap; +#else /** * This is an SGI extension. * @ingroup SGIextensions @@ -465,6 +469,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION 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++ diff --git a/libstdc++-v3/testsuite/ext/is_heap/47709.cc b/libstdc++-v3/testsuite/ext/is_heap/47709.cc new file mode 100644 index 00000000000..5eeaf582cc1 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/is_heap/47709.cc @@ -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()); +} -- 2.11.0