summaryrefslogtreecommitdiff
path: root/include/gtest/internal
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2011-01-10 18:17:59 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2011-01-10 18:17:59 +0000
commit5e255e0b6affbdc56718d81f0bb5d1b802a1c6c2 (patch)
treec8d12776d79b243cb2c9dcb307965b6e4582959d /include/gtest/internal
parentad7287474c874ccd549ce10a04c1ab6ad4f73454 (diff)
downloadgtest-5e255e0b6affbdc56718d81f0bb5d1b802a1c6c2.tar.gz
gtest-5e255e0b6affbdc56718d81f0bb5d1b802a1c6c2.tar.bz2
gtest-5e255e0b6affbdc56718d81f0bb5d1b802a1c6c2.tar.xz
Fixes GCC 4.6 warnings (patch by Jeffrey Yasskin).
git-svn-id: http://googletest.googlecode.com/svn/trunk@531 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'include/gtest/internal')
-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));\
};\