summaryrefslogtreecommitdiffstats
path: root/googletest/test
diff options
context:
space:
mode:
authorDerek Mauro <dmauro@google.com>2024-04-16 20:15:51 (GMT)
committerCopybara-Service <copybara-worker@google.com>2024-04-16 20:16:40 (GMT)
commit5a37b517ad4ab6738556f0284c256cae1466c5b4 (patch)
treec0da707ac6a19f0aacd05199bcd53d42a77481ed /googletest/test
parent5197b1a8e6a1ef9f214f4aa537b0be17cbf91946 (diff)
downloadgoogletest-5a37b517ad4ab6738556f0284c256cae1466c5b4.zip
googletest-5a37b517ad4ab6738556f0284c256cae1466c5b4.tar.gz
googletest-5a37b517ad4ab6738556f0284c256cae1466c5b4.tar.bz2
Use `[[maybe_unused]]` when it is available to avoid
-Wused-but-marked-unused warnings PiperOrigin-RevId: 625430612 Change-Id: Ia9d2e47984e1e6f91966afae8a6750119ae69446
Diffstat (limited to 'googletest/test')
-rw-r--r--googletest/test/gtest_unittest.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index edbe2ea..5ded865 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -2163,7 +2163,7 @@ class UnitTestRecordPropertyTestEnvironment : public Environment {
};
// This will test property recording outside of any test or test case.
-static Environment* record_property_env GTEST_ATTRIBUTE_UNUSED_ =
+GTEST_INTERNAL_ATTRIBUTE_MAYBE_UNUSED static Environment* record_property_env =
AddGlobalTestEnvironment(new UnitTestRecordPropertyTestEnvironment);
// This group of tests is for predicate assertions (ASSERT_PRED*, etc)
@@ -6705,8 +6705,9 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
// Verifies that StaticAssertTypeEq works in a namespace scope.
-static bool dummy1 GTEST_ATTRIBUTE_UNUSED_ = StaticAssertTypeEq<bool, bool>();
-static bool dummy2 GTEST_ATTRIBUTE_UNUSED_ =
+GTEST_INTERNAL_ATTRIBUTE_MAYBE_UNUSED static bool dummy1 =
+ StaticAssertTypeEq<bool, bool>();
+GTEST_INTERNAL_ATTRIBUTE_MAYBE_UNUSED static bool dummy2 =
StaticAssertTypeEq<const int, const int>();
// Verifies that StaticAssertTypeEq works in a class.