From a6becb0ef51f3ccbe31fdb0eaa5f6448d575b062 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 13 Mar 2008 17:35:40 +0000 Subject: [PATCH] re PR libstdc++/35541 (Legal C++ program can't be compiled with -D_GLIBCXX_DEBUG) 2008-03-13 Paolo Carlini PR libstdc++/35541 * include/debug/functions.h (__check_sorted_set_aux): Fix signature. * testsuite/25_algorithms/set_difference/35541.cc: New. From-SVN: r133173 --- libstdc++-v3/ChangeLog | 6 ++++ libstdc++-v3/include/debug/functions.h | 34 +++++++++----------- .../25_algorithms/set_difference/35541.cc | 36 ++++++++++++++++++++++ 3 files changed, 57 insertions(+), 19 deletions(-) create mode 100644 libstdc++-v3/testsuite/25_algorithms/set_difference/35541.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8753df3..fd3bad2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2008-03-13 Paolo Carlini + + PR libstdc++/35541 + * include/debug/functions.h (__check_sorted_set_aux): Fix signature. + * testsuite/25_algorithms/set_difference/35541.cc: New. + 2008-03-07 Jakub Jelinek * config/abi/pre/gnu.ver: Move related diff --git a/libstdc++-v3/include/debug/functions.h b/libstdc++-v3/include/debug/functions.h index 7e7562a..a2b5c5f 100644 --- a/libstdc++-v3/include/debug/functions.h +++ b/libstdc++-v3/include/debug/functions.h @@ -268,35 +268,31 @@ namespace __gnu_debug return __check_sorted_aux(__first, __last, __pred, _Category()); } - template + template inline bool - __check_sorted_set_aux(const _InputIterator1& __first, - const _InputIterator1& __last, - const _InputIterator2&, std::__true_type) + __check_sorted_set_aux(const _InputIterator& __first, + const _InputIterator& __last, + std::__true_type) { return __check_sorted(__first, __last); } - template + template inline bool - __check_sorted_set_aux(const _InputIterator1&, - const _InputIterator1&, - const _InputIterator2&, std::__false_type) + __check_sorted_set_aux(const _InputIterator&, + const _InputIterator&, + std::__false_type) { return true; } - template + template inline bool - __check_sorted_set_aux(const _InputIterator1& __first, - const _InputIterator1& __last, - const _InputIterator2&, _Predicate __pred, - std::__true_type) + __check_sorted_set_aux(const _InputIterator& __first, + const _InputIterator& __last, + _Predicate __pred, std::__true_type) { return __check_sorted(__first, __last, __pred); } - template + template inline bool - __check_sorted_set_aux(const _InputIterator1&, - const _InputIterator1&, - const _InputIterator2&, _Predicate, + __check_sorted_set_aux(const _InputIterator&, + const _InputIterator&, _Predicate, std::__false_type) { return true; } diff --git a/libstdc++-v3/testsuite/25_algorithms/set_difference/35541.cc b/libstdc++-v3/testsuite/25_algorithms/set_difference/35541.cc new file mode 100644 index 0000000..819175d --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/set_difference/35541.cc @@ -0,0 +1,36 @@ +// Copyright (C) 2008 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// { dg-options "-D_GLIBCXX_DEBUG" } +// { dg-do compile } + +// libstdc++/35541 + +#include +#include +#include + +void test01() +{ + std::set > mFactors; + std::set > secondFactor; + std::set_difference(mFactors.begin(), mFactors.end(), + mFactors.begin(), mFactors.end(), + std::insert_iterator > > + (secondFactor, secondFactor.end())); +} -- 2.7.4