From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 6E6273893676; Tue, 6 Apr 2021 15:53:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E6273893676 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-8011] libstdc++: Clarify static_assert message X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: daef4e4d934716b933fa445a0ec6650aeb642751 X-Git-Newrev: 41019bfae2673a818a9b7d08742f3ef91c0deade Message-Id: <20210406155317.6E6273893676@sourceware.org> Date: Tue, 6 Apr 2021 15:53:17 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2021 15:53:17 -0000 https://gcc.gnu.org/g:41019bfae2673a818a9b7d08742f3ef91c0deade commit r11-8011-g41019bfae2673a818a9b7d08742f3ef91c0deade Author: Jonathan Wakely Date: Tue Apr 6 16:34:48 2021 +0100 libstdc++: Clarify static_assert message libstdc++-v3/ChangeLog: * include/bits/move.h (forward): Change static_assert message to be unambiguous about what must be true. * testsuite/20_util/forward/c_neg.cc: Adjust dg-error. * testsuite/20_util/forward/f_neg.cc: Likewise. Diff: --- libstdc++-v3/include/bits/move.h | 2 +- libstdc++-v3/testsuite/20_util/forward/c_neg.cc | 2 +- libstdc++-v3/testsuite/20_util/forward/f_neg.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h index d36e4b28f37..feacae084c9 100644 --- a/libstdc++-v3/include/bits/move.h +++ b/libstdc++-v3/include/bits/move.h @@ -87,7 +87,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION forward(typename std::remove_reference<_Tp>::type&& __t) noexcept { static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument" - " substituting _Tp is an lvalue reference type"); + " substituting _Tp must not be an lvalue reference type"); return static_cast<_Tp&&>(__t); } diff --git a/libstdc++-v3/testsuite/20_util/forward/c_neg.cc b/libstdc++-v3/testsuite/20_util/forward/c_neg.cc index 884100da42e..dc7ec51bde6 100644 --- a/libstdc++-v3/testsuite/20_util/forward/c_neg.cc +++ b/libstdc++-v3/testsuite/20_util/forward/c_neg.cc @@ -17,7 +17,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-error "static assertion failed" "" { target *-*-* } 89 } +// { dg-error "must not be an lvalue reference" "" { target *-*-* } 0 } #include diff --git a/libstdc++-v3/testsuite/20_util/forward/f_neg.cc b/libstdc++-v3/testsuite/20_util/forward/f_neg.cc index 90d3152ffcd..4ccd7264c65 100644 --- a/libstdc++-v3/testsuite/20_util/forward/f_neg.cc +++ b/libstdc++-v3/testsuite/20_util/forward/f_neg.cc @@ -17,7 +17,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-error "static assertion failed" "" { target *-*-* } 89 } +// { dg-error "must not be an lvalue reference" "" { target *-*-* } 0 } #include