]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Clarify static_assert message
authorJonathan Wakely <jwakely@redhat.com>
Tue, 6 Apr 2021 15:34:48 +0000 (16:34 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 6 Apr 2021 15:43:24 +0000 (16:43 +0100)
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.

libstdc++-v3/include/bits/move.h
libstdc++-v3/testsuite/20_util/forward/c_neg.cc
libstdc++-v3/testsuite/20_util/forward/f_neg.cc

index d36e4b28f372563eae7d3853ba3098bcb810d9c4..feacae084c99996d82cc9dd93f93e0254243acb9 100644 (file)
@@ -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);
     }
 
index 884100da42eeef2620fc12f86be7bd8afbbd9ab6..dc7ec51bde626ac384972768f5d2ea17fdb2b3cd 100644 (file)
@@ -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>
 
index 90d3152ffcd4baa97f541271a213b5b101ba4bf7..4ccd7264c651d7b64b1ec43084352bcfde5cb0e3 100644 (file)
@@ -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>