]> 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:50:49 +0000 (10:50 +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.

(cherry picked from commit dd9677f3343ca2a4b4aab9428b8129774accac29)

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

index e4ca2d6bfa999df19d41c62a62aa883d2fd254e2..8f09467d7512ca4596562b6f91979d2b06ce4494 100644 (file)
@@ -483,7 +483,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       size_type
       max_size() const noexcept
-      { return _Impl::_S_max_size(_M_impl._M_alloc); }
+      { return _Impl::_S_max_size(_M_alloc); }
 
       const_reference
       operator[](size_type __n) const noexcept
index 0a358b7b8ff715c281fcb50298ebf524a076bb60..1caa0fd35cb5afdbd36bc993a350fa9d3880178b 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();
 }