diff options
Diffstat (limited to 'dev-cpp/gmock/files')
| -rw-r--r-- | dev-cpp/gmock/files/gmock-1.4.0-gcc-4.7.patch | 189 | ||||
| -rw-r--r-- | dev-cpp/gmock/files/gmock-1.4.0-more-gcc-4.7.patch | 144 |
2 files changed, 333 insertions, 0 deletions
diff --git a/dev-cpp/gmock/files/gmock-1.4.0-gcc-4.7.patch b/dev-cpp/gmock/files/gmock-1.4.0-gcc-4.7.patch new file mode 100644 index 000000000000..fa678220f2a1 --- /dev/null +++ b/dev-cpp/gmock/files/gmock-1.4.0-gcc-4.7.patch @@ -0,0 +1,189 @@ +taken from upstream repo + +Index: include/gmock/gmock-generated-function-mockers.h.pump +=================================================================== +--- include/gmock/gmock-generated-function-mockers.h.pump (revision 227) ++++ include/gmock/gmock-generated-function-mockers.h.pump (revision 228) +@@ -45,10 +45,6 @@ $var n = 10 $$ The maximum arity we sup + #include <gmock/internal/gmock-internal-utils.h> + + namespace testing { +- +-template <typename F> +-class MockSpec; +- + namespace internal { + + template <typename F> +@@ -89,7 +85,11 @@ $if i >= 1 [[ + } + + R Invoke($Aas) { +- return InvokeWith(ArgumentTuple($as)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple($as)); + } + }; + +Index: include/gmock/gmock-generated-function-mockers.h +=================================================================== +--- include/gmock/gmock-generated-function-mockers.h (revision 227) ++++ include/gmock/gmock-generated-function-mockers.h (revision 228) +@@ -42,10 +42,6 @@ + #include <gmock/internal/gmock-internal-utils.h> + + namespace testing { +- +-template <typename F> +-class MockSpec; +- + namespace internal { + + template <typename F> +@@ -71,7 +67,11 @@ class FunctionMocker<R()> : public + } + + R Invoke() { +- return InvokeWith(ArgumentTuple()); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple()); + } + }; + +@@ -88,7 +88,11 @@ class FunctionMocker<R(A1)> : public + } + + R Invoke(A1 a1) { +- return InvokeWith(ArgumentTuple(a1)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1)); + } + }; + +@@ -105,7 +109,11 @@ class FunctionMocker<R(A1, A2)> : public + } + + R Invoke(A1 a1, A2 a2) { +- return InvokeWith(ArgumentTuple(a1, a2)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1, a2)); + } + }; + +@@ -123,7 +131,11 @@ class FunctionMocker<R(A1, A2, A3)> : pu + } + + R Invoke(A1 a1, A2 a2, A3 a3) { +- return InvokeWith(ArgumentTuple(a1, a2, a3)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1, a2, a3)); + } + }; + +@@ -141,7 +153,11 @@ class FunctionMocker<R(A1, A2, A3, A4)> + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) { +- return InvokeWith(ArgumentTuple(a1, a2, a3, a4)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4)); + } + }; + +@@ -161,7 +177,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { +- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5)); + } + }; + +@@ -182,7 +202,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { +- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6)); + } + }; + +@@ -203,7 +227,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { +- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7)); + } + }; + +@@ -224,7 +252,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { +- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8)); + } + }; + +@@ -246,7 +278,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A + } + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { +- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9)); + } + }; + +@@ -270,7 +306,12 @@ class FunctionMocker<R(A1, A2, A3, A4, A + + R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, + A10 a10) { +- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)); ++ // Even though gcc and MSVC don't enforce it, 'this->' is required ++ // by the C++ standard [14.6.4] here, as the base class type is ++ // dependent on the template argument (and thus shouldn't be ++ // looked into when resolving InvokeWith). ++ return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9, ++ a10)); + } + }; + diff --git a/dev-cpp/gmock/files/gmock-1.4.0-more-gcc-4.7.patch b/dev-cpp/gmock/files/gmock-1.4.0-more-gcc-4.7.patch new file mode 100644 index 000000000000..d28a121a474d --- /dev/null +++ b/dev-cpp/gmock/files/gmock-1.4.0-more-gcc-4.7.patch @@ -0,0 +1,144 @@ +taken from upstream repo + +------------------------------------------------------------------------ +r245 | zhanyong.wan | 2009-12-02 03:36:42 -0500 (Wed, 02 Dec 2009) | 2 lines + +Fixes a C++-standard-compliance bug in gmock-printers.h. + + +Index: include/gmock/gmock-printers.h +=================================================================== +--- include/gmock/gmock-printers.h (revision 244) ++++ include/gmock/gmock-printers.h (revision 245) +@@ -434,63 +434,10 @@ inline void PrintTo(const ::std::wstring + // Overload for ::std::tr1::tuple. Needed for printing function + // arguments, which are packed as tuples. + +-typedef ::std::vector<string> Strings; +- +-// This helper template allows PrintTo() for tuples and +-// UniversalTersePrintTupleFieldsToStrings() to be defined by +-// induction on the number of tuple fields. The idea is that +-// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N +-// fields in tuple t, and can be defined in terms of +-// TuplePrefixPrinter<N - 1>. +- +-// The inductive case. +-template <size_t N> +-struct TuplePrefixPrinter { +- // Prints the first N fields of a tuple. +- template <typename Tuple> +- static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { +- TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os); +- *os << ", "; +- UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type> +- ::Print(::std::tr1::get<N - 1>(t), os); +- } +- +- // Tersely prints the first N fields of a tuple to a string vector, +- // one element for each field. +- template <typename Tuple> +- static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { +- TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings); +- ::std::stringstream ss; +- UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss); +- strings->push_back(ss.str()); +- } +-}; +- +-// Base cases. +-template <> +-struct TuplePrefixPrinter<0> { +- template <typename Tuple> +- static void PrintPrefixTo(const Tuple&, ::std::ostream*) {} +- +- template <typename Tuple> +- static void TersePrintPrefixToStrings(const Tuple&, Strings*) {} +-}; +-template <> +-template <typename Tuple> +-void TuplePrefixPrinter<1>::PrintPrefixTo(const Tuple& t, ::std::ostream* os) { +- UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>:: +- Print(::std::tr1::get<0>(t), os); +-} +- + // Helper function for printing a tuple. T must be instantiated with + // a tuple type. + template <typename T> +-void PrintTupleTo(const T& t, ::std::ostream* os) { +- *os << "("; +- TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>:: +- PrintPrefixTo(t, os); +- *os << ")"; +-} ++void PrintTupleTo(const T& t, ::std::ostream* os); + + // Overloaded PrintTo() for tuples of various arities. We support + // tuples of up-to 10 fields. The following implementation works +@@ -725,6 +672,64 @@ void UniversalPrint(const T& value, ::st + UniversalPrinter<T>::Print(value, os); + } + ++typedef ::std::vector<string> Strings; ++ ++// This helper template allows PrintTo() for tuples and ++// UniversalTersePrintTupleFieldsToStrings() to be defined by ++// induction on the number of tuple fields. The idea is that ++// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N ++// fields in tuple t, and can be defined in terms of ++// TuplePrefixPrinter<N - 1>. ++ ++// The inductive case. ++template <size_t N> ++struct TuplePrefixPrinter { ++ // Prints the first N fields of a tuple. ++ template <typename Tuple> ++ static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { ++ TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os); ++ *os << ", "; ++ UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type> ++ ::Print(::std::tr1::get<N - 1>(t), os); ++ } ++ ++ // Tersely prints the first N fields of a tuple to a string vector, ++ // one element for each field. ++ template <typename Tuple> ++ static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { ++ TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings); ++ ::std::stringstream ss; ++ UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss); ++ strings->push_back(ss.str()); ++ } ++}; ++ ++// Base cases. ++template <> ++struct TuplePrefixPrinter<0> { ++ template <typename Tuple> ++ static void PrintPrefixTo(const Tuple&, ::std::ostream*) {} ++ ++ template <typename Tuple> ++ static void TersePrintPrefixToStrings(const Tuple&, Strings*) {} ++}; ++template <> ++template <typename Tuple> ++void TuplePrefixPrinter<1>::PrintPrefixTo(const Tuple& t, ::std::ostream* os) { ++ UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>:: ++ Print(::std::tr1::get<0>(t), os); ++} ++ ++// Helper function for printing a tuple. T must be instantiated with ++// a tuple type. ++template <typename T> ++void PrintTupleTo(const T& t, ::std::ostream* os) { ++ *os << "("; ++ TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>:: ++ PrintPrefixTo(t, os); ++ *os << ")"; ++} ++ + // Prints the fields of a tuple tersely to a string vector, one + // element for each field. See the comment before + // UniversalTersePrint() for how we define "tersely". + +------------------------------------------------------------------------ |
