Skip to content

Commit d62d6c6

Browse files
authored
Merge pull request google#982 from mbjorge/unused-variable-fix
Add GTEST_ATTRIBUTE_UNUSED_ to REGISTER_TYPED_TEST_CASE_P
2 parents 9ae086a + 06a81e9 commit d62d6c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

googletest/include/gtest/gtest-typed-test.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,10 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
241241
namespace GTEST_CASE_NAMESPACE_(CaseName) { \
242242
typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
243243
} \
244-
static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
245-
GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
246-
__FILE__, __LINE__, #__VA_ARGS__)
244+
static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \
245+
GTEST_ATTRIBUTE_UNUSED = \
246+
GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
247+
__FILE__, __LINE__, #__VA_ARGS__)
247248

248249
// The 'Types' template argument below must have spaces around it
249250
// since some compilers may choke on '>>' when passing a template

0 commit comments

Comments
 (0)