public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/giulianob/heads/autopar_rebase2)] libstdc++: Fix test that fails for C++98
@ 2020-08-18 1:21 Giuliano Belinassi
0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-18 1:21 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:2fdc97f1e0f658936032af14718ddbbe7979e39b
commit 2fdc97f1e0f658936032af14718ddbbe7979e39b
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Jul 31 19:58:03 2020 +0100
libstdc++: Fix test that fails for C++98
Local classes have no linkage so cannot be used as template arguments in
C++98.
libstdc++-v3/ChangeLog:
* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/sizes.cc:
Move struct to namespace scope.
Diff:
---
.../uninitialized_fill_n/sizes.cc | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/sizes.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/sizes.cc
index eb957e148da..f6e7a83c58d 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/sizes.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/sizes.cc
@@ -31,19 +31,19 @@ test01()
VERIFY( i[3] == 0 );
}
-void
-test02()
+// The standard only requires that n>0 and --n are valid expressions.
+struct Size
{
- // The standard only requires that n>0 and --n are valid expressions.
- struct Size
- {
- int value;
+ int value;
- void operator--() { --value; }
+ void operator--() { --value; }
- int operator>(void*) { return value != 0; }
- };
+ int operator>(void*) { return value != 0; }
+};
+void
+test02()
+{
int i[5] = { };
Size n = {4};
std::uninitialized_fill_n(i, n, 0xdcba);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-18 1:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 1:21 [gcc(refs/users/giulianob/heads/autopar_rebase2)] libstdc++: Fix test that fails for C++98 Giuliano Belinassi
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).