diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h index 1184337a..fcad3ae2 100644 --- a/googletest/include/gtest/gtest.h +++ b/googletest/include/gtest/gtest.h @@ -2075,9 +2075,7 @@ class GTEST_API_ ScopedTrace { ScopedTrace(const ScopedTrace&) = delete; ScopedTrace& operator=(const ScopedTrace&) = delete; -} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its - // c'tor and d'tor. Therefore it doesn't - // need to be used otherwise. +}; // Causes a trace (including the source file path, the current line // number, and the given message) to be included in every test failure diff --git a/googletest/include/gtest/internal/gtest-death-test-internal.h b/googletest/include/gtest/internal/gtest-death-test-internal.h index 45580ae8..34782170 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 005a0c0d..c3b131f5 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 diff --git a/googletest/src/gtest-internal-inl.h b/googletest/src/gtest-internal-inl.h index 8c650e0c..517cc13a 100644 --- a/googletest/src/gtest-internal-inl.h +++ b/googletest/src/gtest-internal-inl.h @@ -212,7 +212,7 @@ class GTestFlagSaver { int32_t stack_trace_depth_; std::string stream_result_to_; bool throw_on_failure_; -} GTEST_ATTRIBUTE_UNUSED_; +}; // Converts a Unicode code point to a narrow string in UTF-8 encoding. // code_point parameter is of type UInt32 because wchar_t may not be