diff mbox series

[committed,1/2] libstdc++: Define __is_pair variable template for C++11

Message ID 20241107220305.658696-1-jwakely@redhat.com
State New
Headers show
Series [committed,1/2] libstdc++: Define __is_pair variable template for C++11 | expand

Commit Message

Jonathan Wakely Nov. 7, 2024, 10 p.m. UTC
libstdc++-v3/ChangeLog:

	* include/bits/stl_pair.h (__is_pair): Define for C++11 and
	C++14 as well.
---
Tested powerpc64le-linux. Pushed to trunk.

 libstdc++-v3/include/bits/stl_pair.h | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h
index e92fcad2d66..527fb9105f0 100644
--- a/libstdc++-v3/include/bits/stl_pair.h
+++ b/libstdc++-v3/include/bits/stl_pair.h
@@ -1189,12 +1189,18 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Tp1, typename _Tp2>
     inline constexpr size_t tuple_size_v<const pair<_Tp1, _Tp2>> = 2;
+#endif
 
+#if __cplusplus >= 201103L
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++14-extensions" // variable templates
+#pragma GCC diagnostic ignored "-Wc++17-extensions" // inline variables
   template<typename _Tp>
     inline constexpr bool __is_pair = false;
 
   template<typename _Tp, typename _Up>
     inline constexpr bool __is_pair<pair<_Tp, _Up>> = true;
+#pragma GCC diagnostic pop
 #endif
 
   /// @cond undocumented