summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest/internal
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2022-11-15 20:00:32 (GMT)
committerCopybara-Service <copybara-worker@google.com>2022-11-15 20:01:35 (GMT)
commit4408a0288b24fbe9156a9b14bbecd148ea64f40f (patch)
treea5332336d82acc2019e385d55a0eb36a7bff3ede /googletest/include/gtest/internal
parent0e6aac2571eb1753b8855d8d1f592df64d1a4828 (diff)
downloadgoogletest-4408a0288b24fbe9156a9b14bbecd148ea64f40f.zip
googletest-4408a0288b24fbe9156a9b14bbecd148ea64f40f.tar.gz
googletest-4408a0288b24fbe9156a9b14bbecd148ea64f40f.tar.bz2
Remove incorrect usage of GTEST_ATTRIBUTE_UNUSED_ on classes.
Fixes: #4054 PiperOrigin-RevId: 488721587 Change-Id: I8742d8475376635c83edcf524796a6107042e89b
Diffstat (limited to 'googletest/include/gtest/internal')
-rw-r--r--googletest/include/gtest/internal/gtest-death-test-internal.h2
-rw-r--r--googletest/include/gtest/internal/gtest-port.h14
2 files changed, 5 insertions, 11 deletions
diff --git a/googletest/include/gtest/internal/gtest-death-test-internal.h b/googletest/include/gtest/internal/gtest-death-test-internal.h
index 45580ae..3478217 100644
--- a/googletest/include/gtest/internal/gtest-death-test-internal.h
+++ b/googletest/include/gtest/internal/gtest-death-test-internal.h
@@ -99,7 +99,7 @@ class GTEST_API_ DeathTest {
DeathTest* const test_;
ReturnSentinel(const ReturnSentinel&) = delete;
ReturnSentinel& operator=(const ReturnSentinel&) = delete;
- } GTEST_ATTRIBUTE_UNUSED_;
+ };
// An enumeration of possible roles that may be taken when a death
// test is encountered. EXECUTE means that the death test logic should
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index 005a0c0..c3b131f 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -668,17 +668,11 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#define GTEST_HAVE_FEATURE_(x) 0
#endif
-// Use this annotation at the end of a struct/class definition to
-// prevent the compiler from optimizing away instances that are never
-// used. This is useful when all interesting logic happens inside the
-// c'tor and / or d'tor. Example:
-//
-// struct Foo {
-// Foo() { ... }
-// } GTEST_ATTRIBUTE_UNUSED_;
-//
-// Also use it after a variable or parameter declaration to tell the
+// Use this annotation after a variable or parameter declaration to tell the
// compiler the variable/parameter does not have to be used.
+// Example:
+//
+// GTEST_ATTRIBUTE_UNUSED_ int foo = bar();
#if GTEST_HAVE_ATTRIBUTE_(unused)
#define GTEST_ATTRIBUTE_UNUSED_ __attribute__((unused))
#else