[PATCH] D101288: Only ignore -Wdeprecated-copy if the used compiler supports the warning

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 07:01:10 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb125c034af89: Only ignore -Wdeprecated-copy if the used compiler supports the warning (authored by xbolva00).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101288/new/

https://reviews.llvm.org/D101288

Files:
  llvm/utils/unittest/googlemock/include/gmock/gmock-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h


Index: llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h
===================================================================
--- llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h
+++ llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h
@@ -54,7 +54,7 @@
 
 #if GTEST_HAS_PARAM_TEST
 
-#ifdef __clang__
+#if defined(__clang__) && __has_warning("-Wdeprecated-copy")
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-copy"
 #endif
@@ -5146,7 +5146,7 @@
 }  // namespace internal
 }  // namespace testing
 
-#ifdef __clang__
+#if defined(__clang__) &&  __has_warning("-Wdeprecated-copy")
 #pragma clang diagnostic pop
 #endif
 
Index: llvm/utils/unittest/googlemock/include/gmock/gmock.h
===================================================================
--- llvm/utils/unittest/googlemock/include/gmock/gmock.h
+++ llvm/utils/unittest/googlemock/include/gmock/gmock.h
@@ -55,7 +55,7 @@
 //
 // where all clauses are optional and WillOnce() can be repeated.
 
-#ifdef __clang__
+#if defined(__clang__) && __has_warning("-Wdeprecated-copy")
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-copy"
 #endif
@@ -96,7 +96,7 @@
 
 }  // namespace testing
 
-#ifdef __clang__
+#if defined(__clang__) && __has_warning("-Wdeprecated-copy")
 #pragma clang diagnostic pop
 #endif
 #endif  // GMOCK_INCLUDE_GMOCK_GMOCK_H_
Index: llvm/utils/unittest/googlemock/include/gmock/gmock-matchers.h
===================================================================
--- llvm/utils/unittest/googlemock/include/gmock/gmock-matchers.h
+++ llvm/utils/unittest/googlemock/include/gmock/gmock-matchers.h
@@ -58,7 +58,7 @@
 # include <initializer_list>  // NOLINT -- must be after gtest.h
 #endif
 
-#ifdef __clang__
+#if defined(__clang__) && __has_warning("-Wdeprecated-copy")
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-copy"
 #endif
@@ -4421,7 +4421,7 @@
 
 }  // namespace testing
 
-#ifdef __clang__
+#if defined(__clang__) && __has_warning("-Wdeprecated-copy")
 #pragma clang diagnostic pop
 #endif
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101288.340511.patch
Type: text/x-patch
Size: 2168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210426/becc1adf/attachment.bin>


More information about the llvm-commits mailing list