]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix -Wmismatched-tags warnings for _Safe_iterator [PR120112]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 6 May 2025 11:47:32 +0000 (12:47 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 6 May 2025 16:19:25 +0000 (17:19 +0100)
This causes an ICE as shown in the PR, but it should be fixed in the
library code anyway.

libstdc++-v3/ChangeLog:

PR c++/120112
* include/bits/ptr_traits.h (_Safe_iterator_base): Use class
keyword in class-head of declaration.
* include/debug/debug.h (_Safe_iterator): Likewise.

libstdc++-v3/include/bits/ptr_traits.h
libstdc++-v3/include/debug/debug.h

index 4308669e03b75659cdd109f0296f0e6a3479119d..91da88b8c137095bad24b297274f408b64eb9cf1 100644 (file)
@@ -36,7 +36,7 @@
 
 #if __cplusplus > 201703L
 #include <concepts>
-namespace __gnu_debug { struct _Safe_iterator_base; }
+namespace __gnu_debug { class _Safe_iterator_base; }
 #endif
 
 namespace std _GLIBCXX_VISIBILITY(default)
index 0e02d58822a2921fc794129c0a0960254b6d8a4a..0131c0aa59d9ac771e893ebd5f50d4447906f076 100644 (file)
@@ -58,7 +58,7 @@ namespace __gnu_debug
   using namespace std::__debug;
 
   template<typename _Ite, typename _Seq, typename _Cat>
-    struct _Safe_iterator;
+    class _Safe_iterator;
 }
 
 #if ! defined _GLIBCXX_DEBUG || ! _GLIBCXX_HOSTED