public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Clarify static_assert message
@ 2021-04-06 15:54 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-04-06 15:54 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

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.

Tested powerpc64le-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2108 bytes --]

commit 41019bfae2673a818a9b7d08742f3ef91c0deade
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Apr 6 16:34:48 2021

    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 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
 // <http://www.gnu.org/licenses/>.
 
-// { dg-error "static assertion failed" "" { target *-*-* } 89 }
+// { dg-error "must not be an lvalue reference" "" { target *-*-* } 0 }
 
 #include <list>
 
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
 // <http://www.gnu.org/licenses/>.
 
-// { dg-error "static assertion failed" "" { target *-*-* } 89 }
+// { dg-error "must not be an lvalue reference" "" { target *-*-* } 0 }
 
 #include <utility>
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-06 15:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 15:54 [committed] libstdc++: Clarify static_assert message Jonathan Wakely

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).