diff mbox series

[committed] libstdc++: Fix typo in std::stacktrace::max_size [PR115063]

Message ID 20240514095815.368805-1-jwakely@redhat.com
State New
Headers show
Series [committed] libstdc++: Fix typo in std::stacktrace::max_size [PR115063] | expand

Commit Message

Jonathan Wakely May 14, 2024, 9:57 a.m. UTC
Tested x86_64-linux. Pushed to trunk, gcc14 and gcc-13.

-- >8 --

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                    |  2 +-
 .../testsuite/19_diagnostics/stacktrace/stacktrace.cc  | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libstdc++-v3/include/std/stacktrace b/libstdc++-v3/include/std/stacktrace
index 92a69a53d98..d217d63af3b 100644
--- a/libstdc++-v3/include/std/stacktrace
+++ b/libstdc++-v3/include/std/stacktrace
@@ -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
diff --git a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc
index 070c4157471..a49cddfef26 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc
@@ -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();
 }