summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/25_algorithms/generate_n
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-21 16:57:17 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-21 16:57:17 +0000
commit6ec4f2a349652f65572581028598fb0cdaa0d3c7 (patch)
tree759716ca467179a6c260bd41e88fbf2bb7ecd570 /libstdc++-v3/testsuite/25_algorithms/generate_n
parenta8b6351694e817433e38a4d4c2e0faf81f0cb6b8 (diff)
downloadgcc-6ec4f2a349652f65572581028598fb0cdaa0d3c7.tar.gz
2010-05-21 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/25306 * include/bits/stl_algobase.h (fill_n): Use a properly typed __niter initialized to __n. * include/bits/stl_algo.h (generate_n): Likewise. * testsuite/25_algorithms/fill_n/25306.cc: New. * testsuite/25_algorithms/generate_n/25306.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159677 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/25_algorithms/generate_n')
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/generate_n/25306.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/25_algorithms/generate_n/25306.cc b/libstdc++-v3/testsuite/25_algorithms/generate_n/25306.cc
new file mode 100644
index 00000000000..f73ff3d778e
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/generate_n/25306.cc
@@ -0,0 +1,30 @@
+// { dg-do compile }
+
+// Copyright (C) 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
+// 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
+// <http://www.gnu.org/licenses/>.
+
+#include <algorithm>
+
+struct Size
+{
+ operator int() { return 0; }
+private:
+ void operator=(Size&);
+};
+
+// libstdc++/25306
+template int* std::generate_n(int*, Size, int (*)());