diff options
| author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-06-13 19:00:37 +0000 |
|---|---|---|
| committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-06-13 19:00:37 +0000 |
| commit | 95a77adfeb8f97d2a61956e2eda12afe7371f1db (patch) | |
| tree | 800a32dcfa5f87dcd0d6735b57d1c72e14305d5f /include | |
| parent | 86554039f1bc9e84c9e4e22a5af5d2b396fef5a0 (diff) | |
| download | gtest-95a77adfeb8f97d2a61956e2eda12afe7371f1db.tar.gz gtest-95a77adfeb8f97d2a61956e2eda12afe7371f1db.tar.bz2 gtest-95a77adfeb8f97d2a61956e2eda12afe7371f1db.tar.xz | |
Fixes broken build on VC++ 7.1.
git-svn-id: http://googletest.googlecode.com/svn/trunk@584 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'include')
| -rw-r--r-- | include/gtest/gtest-printers.h | 5 | ||||
| -rw-r--r-- | include/gtest/internal/gtest-internal.h | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/include/gtest/gtest-printers.h b/include/gtest/gtest-printers.h index 9cbab3f..55d44fa 100644 --- a/include/gtest/gtest-printers.h +++ b/include/gtest/gtest-printers.h @@ -694,7 +694,10 @@ inline void UniversalTersePrint(char* str, ::std::ostream* os) { // NUL-terminated string. template <typename T> void UniversalPrint(const T& value, ::std::ostream* os) { - UniversalPrinter<T>::Print(value, os); + // A workarond for the bug in VC++ 7.1 that prevents us from instantiating + // UniversalPrinter with T directly. + typedef T T1; + UniversalPrinter<T1>::Print(value, os); } #if GTEST_HAS_TR1_TUPLE diff --git a/include/gtest/internal/gtest-internal.h b/include/gtest/internal/gtest-internal.h index d0fe5f7..d883450 100644 --- a/include/gtest/internal/gtest-internal.h +++ b/include/gtest/internal/gtest-internal.h @@ -802,6 +802,16 @@ struct RemoveConst<const T[N]> { typedef typename RemoveConst<T>::type type[N]; }; +#if defined(_MSC_VER) && _MSC_VER < 1400 +// This is the only specialization that allows VC++ 7.1 to remove const in +// 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC +// and thus needs to be conditionally compiled. +template <typename T, size_t N> +struct RemoveConst<T[N]> { + typedef typename RemoveConst<T>::type type[N]; +}; +#endif + // A handy wrapper around RemoveConst that works when the argument // T depends on template parameters. #define GTEST_REMOVE_CONST_(T) \ |
