public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: William Schmidt <wschmidt@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/users/wschmidt/heads/builtins3)] libstdc++: Fix test that fails for C++98 Date: Tue, 18 Aug 2020 18:20:28 +0000 (GMT) [thread overview] Message-ID: <20200818182028.F41DA3894C3F@sourceware.org> (raw) https://gcc.gnu.org/g:f07fa7a31c89811ad9ffdd9831177cc815f098d2 commit f07fa7a31c89811ad9ffdd9831177cc815f098d2 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);
reply other threads:[~2020-08-18 18:20 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200818182028.F41DA3894C3F@sourceware.org \ --to=wschmidt@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).