[PATCH] D41368: [libc++] Ignore bogus tautologic comparison warnings

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 15:08:48 PST 2017


smeenai updated this revision to Diff 127416.
smeenai added a comment.

Remove stray comment


Repository:
  rCXX libc++

https://reviews.llvm.org/D41368

Files:
  include/istream
  src/string.cpp


Index: src/string.cpp
===================================================================
--- src/string.cpp
+++ src/string.cpp
@@ -80,6 +80,11 @@
 V
 as_integer(const string& func, const S& s, size_t* idx, int base);
 
+#if __clang_major__ >= 6
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtautological-constant-compare"
+#endif
+
 // string
 template<>
 inline
@@ -93,6 +98,10 @@
     return static_cast<int>(r);
 }
 
+#if __clang_major__ >= 6
+#pragma clang diagnostic pop
+#endif
+
 template<>
 inline
 long
@@ -125,6 +134,11 @@
     return as_integer_helper<unsigned long long>( func, s, idx, base, strtoull );
 }
 
+#if __clang_major__ >= 6
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtautological-constant-compare"
+#endif
+
 // wstring
 template<>
 inline
@@ -138,6 +152,10 @@
     return static_cast<int>(r);
 }
 
+#if __clang_major__ >= 6
+#pragma clang diagnostic pop
+#endif
+
 template<>
 inline
 long
Index: include/istream
===================================================================
--- include/istream
+++ include/istream
@@ -695,6 +695,11 @@
     return *this;
 }
 
+#if __clang_major__ >= 6
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtautological-constant-compare"
+#endif
+
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(int& __n)
@@ -735,6 +740,10 @@
     return *this;
 }
 
+#if __clang_major__ >= 6
+#pragma clang diagnostic pop
+#endif
+
 template<class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41368.127416.patch
Type: text/x-patch
Size: 1646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171218/1c49cf08/attachment.bin>


More information about the cfe-commits mailing list