From: Jonathan Wakely Date: Tue, 6 Apr 2021 15:34:48 +0000 (+0100) Subject: libstdc++: Clarify static_assert message X-Git-Tag: basepoints/gcc-12~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41019bfae2673a818a9b7d08742f3ef91c0deade;p=thirdparty%2Fgcc.git 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 --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h index d36e4b28f372..feacae084c99 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 884100da42ee..dc7ec51bde62 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 90d3152ffcd4..4ccd7264c651 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