]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix typo in std::stacktrace::max_size [PR115063]
authorJonathan Wakely <jwakely@redhat.com>
Mon, 13 May 2024 15:25:13 +0000 (16:25 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 14 May 2024 09:53:37 +0000 (10:53 +0100)
libstdc++-v3/ChangeLog:

PR libstdc++/115063
* include/std/stacktrace (basic_stacktrace::max_size): Fix typo
in reference to _M_alloc member.
* testsuite/19_diagnostics/stacktrace/stacktrace.cc: Check
max_size() compiles.

libstdc++-v3/include/std/stacktrace
libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc

index 92a69a53d986c5da990594e3f35e724b0a16b501..d217d63af3bb4420811391f81f959c53a2fd3814 100644 (file)
@@ -430,7 +430,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       [[nodiscard]]
       size_type
       max_size() const noexcept
-      { return _Impl::_S_max_size(_M_impl._M_alloc); }
+      { return _Impl::_S_max_size(_M_alloc); }
 
       [[nodiscard]]
       const_reference
index 070c4157471c2bec29d5f20fa8549dc11aba9878..a49cddfef26839ac5e17a07e35e1e3011b90adfb 100644 (file)
@@ -206,10 +206,20 @@ test_pr105031()
   s = auto(s);
 }
 
+void
+test_pr115063()
+{
+  // PR libstdc++/115063
+  // compilation error: std::basic_stracktrace::max_size()
+  std::stacktrace s;
+  VERIFY( s.max_size() != 0 );
+}
+
 int main()
 {
   test_cons();
   test_assign();
   test_swap();
   test_pr105031();
+  test_pr115063();
 }