summaryrefslogtreecommitdiffstats
path: root/include/gtest/internal/gtest-internal.h
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2011-01-10 18:17:59 (GMT)
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2011-01-10 18:17:59 (GMT)
commit48b1315108cdba8f37394aedb8098102ca00e8b9 (patch)
treec8d12776d79b243cb2c9dcb307965b6e4582959d /include/gtest/internal/gtest-internal.h
parentafaefb0e30366cf8bedb41daf14dc9e17a5d1ff9 (diff)
downloadgoogletest-48b1315108cdba8f37394aedb8098102ca00e8b9.zip
googletest-48b1315108cdba8f37394aedb8098102ca00e8b9.tar.gz
googletest-48b1315108cdba8f37394aedb8098102ca00e8b9.tar.bz2
Fixes GCC 4.6 warnings (patch by Jeffrey Yasskin).
Diffstat (limited to 'include/gtest/internal/gtest-internal.h')
-rw-r--r--include/gtest/internal/gtest-internal.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/gtest/internal/gtest-internal.h b/include/gtest/internal/gtest-internal.h
index 3307855..2c08238 100644
--- a/include/gtest/internal/gtest-internal.h
+++ b/include/gtest/internal/gtest-internal.h
@@ -919,6 +919,13 @@ typedef char IsNotContainer;
template <class C>
IsNotContainer IsContainerTest(...) { return '\0'; }
+// EnableIf<condition>::type is void when 'Cond' is true, and
+// undefined when 'Cond' is false. To use SFINAE to make a function
+// overload only apply when a particular expression is true, add
+// "typename EnableIf<expression>::type* = 0" as the last parameter.
+template<bool> struct EnableIf;
+template<> struct EnableIf<true> { typedef void type; }; // NOLINT
+
// Utilities for native arrays.
// ArrayEq() compares two k-dimensional native arrays using the
@@ -1182,7 +1189,7 @@ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
private:\
virtual void TestBody();\
- static ::testing::TestInfo* const test_info_;\
+ static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
GTEST_DISALLOW_COPY_AND_ASSIGN_(\
GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
};\