]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix more pedwarns in headers for C++98
authorJonathan Wakely <jwakely@redhat.com>
Fri, 27 Sep 2024 20:01:46 +0000 (21:01 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 27 Sep 2024 22:55:11 +0000 (23:55 +0100)
Some tests e.g.  17_intro/headers/c++1998/all_pedantic_errors.cc FAIL
with GLIBCXX_TESTSUITE_STDS=98 due to numerous C++11 extensions still in
use in the library headers. The recent changes to not make them system
headers means we get warnings now.

This change adds more diagnostic pragmas to suppress those warnings.

libstdc++-v3/ChangeLog:

* include/bits/istream.tcc: Add diagnostic pragmas around uses
of long long and extern template.
* include/bits/locale_facets.h: Likewise.
* include/bits/locale_facets.tcc: Likewise.
* include/bits/locale_facets_nonio.tcc: Likewise.
* include/bits/ostream.tcc: Likewise.
* include/bits/stl_algobase.h: Likewise.
* include/c_global/cstdlib: Likewise.
* include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp:
Likewise.
* include/ext/pointer.h: Likewise.
* include/ext/stdio_sync_filebuf.h: Likewise.
* include/std/istream: Likewise.
* include/std/ostream: Likewise.
* include/tr1/cmath: Likewise.
* include/tr1/type_traits: Likewise.
* include/tr1/functional_hash.h: Likewise. Remove semi-colons
at namespace scope that aren't needed after macro expansion.
* include/tr1/tuple: Remove semi-colon at namespace scope.
* include/bits/vector.tcc: Change LL suffix to just L.

17 files changed:
libstdc++-v3/include/bits/istream.tcc
libstdc++-v3/include/bits/locale_facets.h
libstdc++-v3/include/bits/locale_facets.tcc
libstdc++-v3/include/bits/locale_facets_nonio.tcc
libstdc++-v3/include/bits/ostream.tcc
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/bits/vector.tcc
libstdc++-v3/include/c_global/cstdlib
libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
libstdc++-v3/include/ext/pointer.h
libstdc++-v3/include/ext/stdio_sync_filebuf.h
libstdc++-v3/include/std/istream
libstdc++-v3/include/std/ostream
libstdc++-v3/include/tr1/cmath
libstdc++-v3/include/tr1/functional_hash.h
libstdc++-v3/include/tr1/tuple
libstdc++-v3/include/tr1/type_traits

index e8957fd2c3bf85c26fa3b3641786c84e8ced39a9..f96d2d4a35367974dd3b23aad8aa7acbc257d7c8 100644 (file)
@@ -397,7 +397,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
              __streambuf_type* __this_sb = this->rdbuf();
              int_type __c = __this_sb->sgetc();
              char_type __c2 = traits_type::to_char_type(__c);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
              unsigned long long __gcount = 0;
+#pragma GCC diagnostic pop
 
              while (!traits_type::eq_int_type(__c, __eof)
                     && !traits_type::eq_int_type(__c, __idelim)
@@ -1122,6 +1125,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template
+#pragma GCC diagnostic ignored "-Wlong-long"
   extern template class basic_istream<char>;
   extern template istream& ws(istream&);
   extern template istream& operator>>(istream&, char&);
@@ -1134,8 +1140,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   extern template istream& istream::_M_extract(unsigned long&);
   extern template istream& istream::_M_extract(bool&);
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
   extern template istream& istream::_M_extract(long long&);
   extern template istream& istream::_M_extract(unsigned long long&);
+#pragma GCC diagnostic pop
 #endif
   extern template istream& istream::_M_extract(float&);
   extern template istream& istream::_M_extract(double&);
@@ -1166,6 +1175,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   extern template class basic_iostream<wchar_t>;
 #endif
+#pragma GCC diagnostic pop
 #endif
 
 _GLIBCXX_END_NAMESPACE_VERSION
index afa239ad96a71014af6dd54d7d0021f34f21c960..0daffc86de281110ac2f2729451f8de34dde46f0 100644 (file)
@@ -2063,6 +2063,8 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
       { return this->do_get(__in, __end, __io, __err, __v); }
 
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       iter_type
       get(iter_type __in, iter_type __end, ios_base& __io,
          ios_base::iostate& __err, long long& __v) const
@@ -2072,6 +2074,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
       get(iter_type __in, iter_type __end, ios_base& __io,
          ios_base::iostate& __err, unsigned long long& __v)  const
       { return this->do_get(__in, __end, __io, __err, __v); }
+#pragma GCC diagnostic pop
 #endif
       ///@}
 
@@ -2242,6 +2245,8 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
       { return _M_extract_int(__beg, __end, __io, __err, __v); }
 
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       virtual iter_type
       do_get(iter_type __beg, iter_type __end, ios_base& __io,
             ios_base::iostate& __err, long long& __v) const
@@ -2251,6 +2256,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
       do_get(iter_type __beg, iter_type __end, ios_base& __io,
             ios_base::iostate& __err, unsigned long long& __v) const
       { return _M_extract_int(__beg, __end, __io, __err, __v); }
+#pragma GCC diagnostic pop
 #endif
 
       virtual iter_type
@@ -2407,6 +2413,8 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
       { return this->do_put(__s, __io, __fill, __v); }
 
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       iter_type
       put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const
       { return this->do_put(__s, __io, __fill, __v); }
@@ -2415,6 +2423,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
       put(iter_type __s, ios_base& __io, char_type __fill,
          unsigned long long __v) const
       { return this->do_put(__s, __io, __fill, __v); }
+#pragma GCC diagnostic pop
 #endif
       ///@}
 
@@ -2546,6 +2555,8 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
       { return _M_insert_int(__s, __io, __fill, __v); }
 
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       virtual iter_type
       do_put(iter_type __s, ios_base& __io, char_type __fill,
             long long __v) const
@@ -2555,6 +2566,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
       do_put(iter_type __s, ios_base& __io, char_type __fill,
             unsigned long long __v) const
       { return _M_insert_int(__s, __io, __fill, __v); }
+#pragma GCC diagnostic pop
 #endif
 
       virtual iter_type
index 14e87ab0ed35c4de44e7baf4a9d6092d0e302ff8..1486d0027a5b1485e3a10f72d55e2051210c9e16 100644 (file)
@@ -762,9 +762,12 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
       const fmtflags __fmt = __io.flags();
       __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       typedef __gnu_cxx::__conditional_type<(sizeof(void*)
                                             <= sizeof(unsigned long)),
        unsigned long, unsigned long long>::__type _UIntPtrType;       
+#pragma GCC diagnostic pop
 
       _UIntPtrType __ul;
       __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
@@ -1206,9 +1209,12 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
                                         | ios_base::uppercase);
       __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase));
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
                                             <= sizeof(unsigned long)),
        unsigned long, unsigned long long>::__type _UIntPtrType;       
+#pragma GCC diagnostic pop
 
       __s = _M_insert_int(__s, __io, __fill,
                          reinterpret_cast<_UIntPtrType>(__v));
index 7b597c86aeac27e18228e6c3084d3233da58fa95..5fddc1e3b269e09b346140873db021a1ad90622b 100644 (file)
@@ -1679,6 +1679,9 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template
+#pragma GCC diagnostic ignored "-Wlong-long"
   extern template class moneypunct<char, false>;
   extern template class moneypunct<char, true>;
   extern template class moneypunct_byname<char, false>;
@@ -1892,6 +1895,7 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
     bool
     has_facet<messages<wchar_t> >(const locale&);
 #endif
+#pragma GCC diagnostic pop
 #endif
 
 _GLIBCXX_END_NAMESPACE_VERSION
index 06cf2da1e0706877245bd6ef0a76d0d8155daa43..bda342f24b4762f8bef735a7baa127489f663d60 100644 (file)
@@ -361,8 +361,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   extern template ostream& ostream::_M_insert(unsigned long);
   extern template ostream& ostream::_M_insert(bool);
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
   extern template ostream& ostream::_M_insert(long long);
   extern template ostream& ostream::_M_insert(unsigned long long);
+#pragma GCC diagnostic pop
 #endif
   extern template ostream& ostream::_M_insert(double);
   extern template ostream& ostream::_M_insert(long double);
@@ -382,8 +385,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   extern template wostream& wostream::_M_insert(unsigned long);
   extern template wostream& wostream::_M_insert(bool);
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
   extern template wostream& wostream::_M_insert(long long);
   extern template wostream& wostream::_M_insert(unsigned long long);
+#pragma GCC diagnostic pop
 #endif
   extern template wostream& wostream::_M_insert(double);
   extern template wostream& wostream::_M_insert(long double);
index f13662fc4482be971ff219e08d2588386d10b2ca..9e92211c12460949a40906695a5a76bc767efa6a 100644 (file)
@@ -937,6 +937,8 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
     __fill_a1(_ForwardIterator __first, _ForwardIterator __last,
              const _Tp& __value)
     {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       // We can optimize this loop by moving the load from __value outside
       // the loop, but only if we know that making that copy is trivial,
       // and the assignment in the loop is also trivial (so that the identity
@@ -951,6 +953,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
            && __is_same(_Tp, __typeof__(*__first))
 #endif
            && sizeof(_Tp) <= sizeof(long long);
+#pragma GCC diagnostic pop
 
       // When the condition is true, we use a copy of __value,
       // otherwise we just use another reference.
@@ -1040,6 +1043,8 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
       std::__fill_a(__first, __last, __value);
     }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
   // Used by fill_n, generate_n, etc. to convert _Size to an integral type:
   inline _GLIBCXX_CONSTEXPR int
   __size_to_integer(int __n) { return __n; }
@@ -1089,9 +1094,11 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
   __extension__ inline _GLIBCXX_CONSTEXPR long long
   __size_to_integer(__float128 __n) { return (long long)__n; }
 #endif
+#pragma GCC diagnostic pop
 
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wc++17-extensions"
+#pragma GCC diagnostic ignored "-Wlong-long"
   template<typename _OutputIterator, typename _Size, typename _Tp>
     _GLIBCXX20_CONSTEXPR
     inline _OutputIterator
@@ -1574,6 +1581,8 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
 #if __cplusplus >= 201402L
       return std::__bit_width(make_unsigned_t<_Tp>(__n)) - 1;
 #else
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       // Use +__n so it promotes to at least int.
       return (sizeof(+__n) * __CHAR_BIT__ - 1)
               - (sizeof(+__n) == sizeof(long long)
@@ -1581,6 +1590,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
                    : (sizeof(+__n) == sizeof(long)
                         ? __builtin_clzl(+__n)
                         : __builtin_clz(+__n)));
+#pragma GCC diagnostic pop
 #endif
     }
 
index c500aab9e561f9e5742bac6732606824ede1d99e..a99a5b56b77a2041f93de0ea78ebda80539f1671 100644 (file)
@@ -933,7 +933,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 
                const size_type __len =
                  _M_check_len(__n, "vector::_M_range_insert");
-#if __cplusplus < 201103LL
+#if __cplusplus < 201103L
                if (__len < (__n + (__old_start - __old_finish)))
                  __builtin_unreachable();
 #endif
index a5df4cd9cb11e4b287da80f9113871fa39a9ae9d..590e17cf7a1e9b53c3b26349c3455106d9cee3d5 100644 (file)
@@ -217,6 +217,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #endif
 
 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
   using ::llabs;
 
   inline lldiv_t
@@ -224,6 +226,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
 
   using ::lldiv;
+#pragma GCC diagnostic pop
 #endif
 
 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
index 8fdec6d575495c2c9df8e2151e7ed34aa942f34e..910a670dd0319eb74be2090b6fde2a953e8751af 100644 (file)
@@ -62,6 +62,8 @@ namespace detail
 #endif
     };
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
   // Originally taken from the SGI implementation; acknowledged in the docs.
   // Further modified (for 64 bits) from tr1's hashtable.
   static const std::size_t g_a_sizes[num_distinct_sizes] =
@@ -133,6 +135,7 @@ namespace detail
 #endif
 #endif
     };
+#pragma GCC diagnostic pop
 
 } // namespace detail
 
index ab3016e225db41f2398ec74dbed7f20774fa2365..ae0a9a1280c9b9401f90e32c1526d6d53db4689c 100644 (file)
@@ -439,8 +439,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       _CXX_POINTER_ARITH_OPERATOR_SET(long);
       _CXX_POINTER_ARITH_OPERATOR_SET(unsigned long);
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       _CXX_POINTER_ARITH_OPERATOR_SET(long long);
       _CXX_POINTER_ARITH_OPERATOR_SET(unsigned long long);
+#pragma GCC diagnostic pop
 #endif
 
       // Mathematical Manipulators
index 0f5381d9cb562629e926410b4831ae6b955eef4d..26c5783bb8d477596923fbdfdc2b4fe888510d39 100644 (file)
@@ -310,10 +310,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #endif
 
 #if _GLIBCXX_EXTERN_TEMPLATE
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++11-extensions"
   extern template class stdio_sync_filebuf<char>;
 #ifdef _GLIBCXX_USE_WCHAR_T
   extern template class stdio_sync_filebuf<wchar_t>;
 #endif
+#pragma GCC diagnostic pop
 #endif
 
 _GLIBCXX_END_NAMESPACE_VERSION
index 54a130d82f01bd4834c3afffc14457dab9ea9244..ef773977ed48690e4af403cacce3ab358de1a026 100644 (file)
@@ -195,6 +195,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { return _M_extract(__n); }
 
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       __istream_type&
       operator>>(long long& __n)
       { return _M_extract(__n); }
@@ -202,6 +204,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       __istream_type&
       operator>>(unsigned long long& __n)
       { return _M_extract(__n); }
+#pragma GCC diagnostic pop
 #endif
       ///@}
 
index a1cb7ce1765e770d926cb25257fd7ca817152fef..637aad5a5a41bfe4a19c7c415d140bffd4b67d19 100644 (file)
@@ -207,6 +207,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       }
 
 #ifdef _GLIBCXX_USE_LONG_LONG
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
       __ostream_type&
       operator<<(long long __n)
       { return _M_insert(__n); }
@@ -214,6 +216,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       __ostream_type&
       operator<<(unsigned long long __n)
       { return _M_insert(__n); }
+#pragma GCC diagnostic pop
 #endif
       ///@}
 
index bc1e562084aa5aab2f69c85ee82d364fd64a7a81..2057538af851797b5aa6d3c43ba014056e0cbafe 100644 (file)
@@ -762,6 +762,9 @@ namespace tr1
     lgamma(_Tp __x)
     { return __builtin_lgamma(__x); }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
+
 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
   inline long long
   llrint(float __x)
@@ -793,6 +796,7 @@ namespace tr1
                                           long long>::__type
     llround(_Tp __x)
     { return __builtin_llround(__x); }
+#pragma GCC diagnostic pop
 
 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
   inline float
index 01ebfc907dbd71e432bf93bf1a2b0ff3d1dafbc1..707d35f9da9b8b3bebec29cc1848c42418f69d2f 100644 (file)
@@ -71,19 +71,22 @@ namespace tr1
     hash<_Tp>::operator()(_Tp __val) const             \
     { return static_cast<size_t>(__val); }
 
-  _TR1_hashtable_define_trivial_hash(bool);
-  _TR1_hashtable_define_trivial_hash(char);
-  _TR1_hashtable_define_trivial_hash(signed char);
-  _TR1_hashtable_define_trivial_hash(unsigned char);
-  _TR1_hashtable_define_trivial_hash(wchar_t);
-  _TR1_hashtable_define_trivial_hash(short);
-  _TR1_hashtable_define_trivial_hash(int);
-  _TR1_hashtable_define_trivial_hash(long);
-  _TR1_hashtable_define_trivial_hash(long long);
-  _TR1_hashtable_define_trivial_hash(unsigned short);
-  _TR1_hashtable_define_trivial_hash(unsigned int);
-  _TR1_hashtable_define_trivial_hash(unsigned long);
-  _TR1_hashtable_define_trivial_hash(unsigned long long);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
+  _TR1_hashtable_define_trivial_hash(bool)
+  _TR1_hashtable_define_trivial_hash(char)
+  _TR1_hashtable_define_trivial_hash(signed char)
+  _TR1_hashtable_define_trivial_hash(unsigned char)
+  _TR1_hashtable_define_trivial_hash(wchar_t)
+  _TR1_hashtable_define_trivial_hash(short)
+  _TR1_hashtable_define_trivial_hash(int)
+  _TR1_hashtable_define_trivial_hash(long)
+  _TR1_hashtable_define_trivial_hash(long long)
+  _TR1_hashtable_define_trivial_hash(unsigned short)
+  _TR1_hashtable_define_trivial_hash(unsigned int)
+  _TR1_hashtable_define_trivial_hash(unsigned long)
+  _TR1_hashtable_define_trivial_hash(unsigned long long)
+#pragma GCC diagnostic pop
 
 #undef _TR1_hashtable_define_trivial_hash
 
@@ -135,6 +138,8 @@ namespace tr1
         static size_t
         hash(const _Tp* __ptr, size_t __clength)
         {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
          size_t __result
            = static_cast<size_t>(14695981039346656037ULL);
          const char* __cptr = reinterpret_cast<const char*>(__ptr);
@@ -144,6 +149,7 @@ namespace tr1
              __result *= static_cast<size_t>(1099511628211ULL);
            }
          return __result;
+#pragma GCC diagnostic pop
        }
     };
 
index e53fca75944d39376c9de120942f0dea93826047..b5c62b585a9acfa2c4c5f20e81c5497ed40c1d78 100644 (file)
@@ -424,7 +424,7 @@ namespace tr1
   namespace
   {
     _Swallow_assign ignore;
-  }; // anonymous namespace
+  } // anonymous namespace
 }
 
 _GLIBCXX_END_NAMESPACE_VERSION
index c4ce2d7125c9bbcfb8a0465029727d88fdbf6f58..5e55802fba715caad0f81f529846810b7b81c615 100644 (file)
@@ -123,8 +123,11 @@ namespace tr1
   _DEFINE_SPEC(0, __is_integral_helper, unsigned int, true)
   _DEFINE_SPEC(0, __is_integral_helper, long, true)
   _DEFINE_SPEC(0, __is_integral_helper, unsigned long, true)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
   _DEFINE_SPEC(0, __is_integral_helper, long long, true)
   _DEFINE_SPEC(0, __is_integral_helper, unsigned long long, true)
+#pragma GCC diagnostic pop
 
   /// is_integral
   template<typename _Tp>
@@ -544,6 +547,8 @@ namespace tr1
     : public integral_constant<bool, is_pod<_Tp>::value>
     { };
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
   template<typename>
     struct __is_signed_helper
     : public false_type { };
@@ -567,6 +572,7 @@ namespace tr1
   _DEFINE_SPEC(0, __is_unsigned_helper, unsigned int, true)
   _DEFINE_SPEC(0, __is_unsigned_helper, unsigned long, true)
   _DEFINE_SPEC(0, __is_unsigned_helper, unsigned long long, true)
+#pragma GCC diagnostic pop
 
   template<typename _Tp>
     struct is_unsigned