summaryrefslogtreecommitdiffstats
path: root/googletest/include
diff options
context:
space:
mode:
authorMike Bjorge <mbjorge@google.com>2017-01-10 00:02:55 (GMT)
committerMike Bjorge <mbjorge@google.com>2017-01-10 00:02:55 (GMT)
commit06a81e9357b6e5cf023ac65b7468191cd1949d42 (patch)
treecbb1bebfc788fc467c982bd31df498f81846a9d9 /googletest/include
parent5e7fd50e17b6edf1cadff973d0ec68966cf3265e (diff)
downloadgoogletest-06a81e9357b6e5cf023ac65b7468191cd1949d42.zip
googletest-06a81e9357b6e5cf023ac65b7468191cd1949d42.tar.gz
googletest-06a81e9357b6e5cf023ac65b7468191cd1949d42.tar.bz2
Add GTEST_ATTRIBUTE_UNUSED_ to REGISTER_TYPED_TEST_CASE_Prefs/pull/982/head
If REGISTER_TYPED_TEST_CASE_P is included in a header file, but the .cc file does not declare INSTANTIATE_TYPED_TEST_CASE_P, an unused-variable warning may be raised by the compiler.
Diffstat (limited to 'googletest/include')
-rw-r--r--googletest/include/gtest/gtest-typed-test.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h
index 5f69d56..f4be9e5 100644
--- a/googletest/include/gtest/gtest-typed-test.h
+++ b/googletest/include/gtest/gtest-typed-test.h
@@ -241,9 +241,10 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
namespace GTEST_CASE_NAMESPACE_(CaseName) { \
typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
} \
- static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
- GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
- __FILE__, __LINE__, #__VA_ARGS__)
+ static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \
+ GTEST_ATTRIBUTE_UNUSED = \
+ GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
+ __FILE__, __LINE__, #__VA_ARGS__)
// The 'Types' template argument below must have spaces around it
// since some compilers may choke on '>>' when passing a template