public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [v3] libstdc++/35541
@ 2008-03-13 17:37 Paolo Carlini
  0 siblings, 0 replies; only message in thread
From: Paolo Carlini @ 2008-03-13 17:37 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: libstdc++

[-- Attachment #1: Type: text/plain, Size: 98 bytes --]

Hi,

tested x86_64-linux, committed to mainline and 4_3-branch.

Paolo.

////////////////////////

[-- Attachment #2: CL_35541 --]
[-- Type: text/plain, Size: 195 bytes --]

2008-03-13  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/35541
	* include/debug/functions.h (__check_sorted_set_aux): Fix signature.
	* testsuite/25_algorithms/set_difference/35541.cc: New.


[-- Attachment #3: patch_35541 --]
[-- Type: text/plain, Size: 3681 bytes --]

Index: include/debug/functions.h
===================================================================
--- include/debug/functions.h	(revision 133172)
+++ include/debug/functions.h	(working copy)
@@ -268,35 +268,31 @@
       return __check_sorted_aux(__first, __last, __pred, _Category());
     }
 
-  template<typename _InputIterator1, typename _InputIterator2>
+  template<typename _InputIterator>
     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<typename _InputIterator1, typename _InputIterator2>
+  template<typename _InputIterator>
     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<typename _InputIterator1, typename _InputIterator2,
-	   typename _Predicate>
+  template<typename _InputIterator, typename _Predicate>
     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<typename _InputIterator1, typename _InputIterator2,
-	   typename _Predicate>
+  template<typename _InputIterator, typename _Predicate>
     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; }
 
Index: testsuite/25_algorithms/set_difference/35541.cc
===================================================================
--- testsuite/25_algorithms/set_difference/35541.cc	(revision 0)
+++ testsuite/25_algorithms/set_difference/35541.cc	(revision 0)
@@ -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 <set>
+#include <iterator>
+#include <algorithm>
+
+void test01()
+{
+  std::set<std::pair<unsigned,int> > mFactors;
+  std::set<std::pair<unsigned,int> > secondFactor;
+  std::set_difference(mFactors.begin(), mFactors.end(),
+		      mFactors.begin(), mFactors.end(),
+		      std::insert_iterator<std::set<std::pair<unsigned,int> > >
+		      (secondFactor, secondFactor.end())); 
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-13 17:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-13 17:37 [v3] libstdc++/35541 Paolo Carlini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).