diff options
| author | sana kazi <sanakazisk19@gmail.com> | 2023-06-19 13:35:53 +0530 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2023-06-19 07:19:41 -0400 |
| commit | 8fb1e24fcc5fdaaafbfa03852c7b8bc3e995fe62 (patch) | |
| tree | 54f1679ace9d27c50c5554849d4a8967cfe73982 | |
| parent | 5790310da3eeed427d8911905ede545386db35a0 (diff) | |
| download | meta-openembedded-8fb1e24fcc5fdaaafbfa03852c7b8bc3e995fe62.tar.gz | |
Googletest: Adapt googletest 1.11.0 with gcc11
Backport a commit to fix the build error when using gcc11.
[commit]
https://github.com/google/googletest/pull/3993/commits/096014a45dc38dff993f5b7bb28a258d8323344b
[error]
/usr/include/gtest/gtest-printers.h:291:36: error: no matching function for call to
‘testing::internal::internal_stream_operator_without_lexical_name_lookup::StreamPrinter::PrintValue(const A::B::C::D::E::F::G&, std::nullptr_t)’
291 | T, decltype(Printer::PrintValue(std::declval<const T&>(), nullptr)),
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtest/gtest-printers.h:214:15: note: candidate: ‘template<class T, class, class> static void testing::internal::internal_stream_operator_without_lexical_name_lookup::StreamPrinter::PrintValue(const T&, std::ostream*)’
214 | static void PrintValue(const T& value, ::std::ostream* os) {
| ^~~~~~~~~~
Signed-off-by: Peng Cui <peng.ca.cui@bmw.com>
Signed-off-by: Sana Kazi <sana.kazi@kpit.com>
Signed-off-by: Sana Kazi <sanakazisk19@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
| -rw-r--r-- | meta-oe/recipes-test/googletest/files/0001-work-around-GCC-6-11-ADL-bug.patch | 42 | ||||
| -rw-r--r-- | meta-oe/recipes-test/googletest/googletest_git.bb | 3 |
2 files changed, 44 insertions, 1 deletions
diff --git a/meta-oe/recipes-test/googletest/files/0001-work-around-GCC-6-11-ADL-bug.patch b/meta-oe/recipes-test/googletest/files/0001-work-around-GCC-6-11-ADL-bug.patch new file mode 100644 index 0000000000..c2828e6a94 --- /dev/null +++ b/meta-oe/recipes-test/googletest/files/0001-work-around-GCC-6-11-ADL-bug.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 8c70e2680bec526012d96578160901e4c24e1c48 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Paul Groke <paul.groke@dynatrace.com> | ||
| 3 | Date: Thu, 15 Sep 2022 13:36:49 +0200 | ||
| 4 | Subject: [PATCH] work around GCC 6~11 ADL bug | ||
| 5 | |||
| 6 | see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51577 | ||
| 7 | ADL seems to work properly when we do the SFINAE check via the return type, but not when using a dummy template parameter | ||
| 8 | |||
| 9 | fix #3992 | ||
| 10 | Upstream-Status: Backport [https://github.com/google/googletest/pull/3993/commits/096014a45dc38dff993f5b7bb28a258d8323344b] | ||
| 11 | Signed-off-by: Paul Groke <paul.groke@dynatrace.com> | ||
| 12 | Signed-off-by: Sana Kazi <sana.kazi@kpit.com> | ||
| 13 | --- | ||
| 14 | googletest/include/gtest/gtest-printers.h | 13 +++++++------ | ||
| 15 | 1 file changed, 7 insertions(+), 6 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h | ||
| 18 | index 8e4d295344..19c3e0b69b 100644 | ||
| 19 | --- a/googletest/include/gtest/gtest-printers.h | ||
| 20 | +++ b/googletest/include/gtest/gtest-printers.h | ||
| 21 | @@ -205,12 +205,13 @@ struct StreamPrinter { | ||
| 22 | // Don't accept member pointers here. We'd print them via implicit | ||
| 23 | // conversion to bool, which isn't useful. | ||
| 24 | typename = typename std::enable_if< | ||
| 25 | - !std::is_member_pointer<T>::value>::type, | ||
| 26 | - // Only accept types for which we can find a streaming operator via | ||
| 27 | - // ADL (possibly involving implicit conversions). | ||
| 28 | - typename = decltype(std::declval<std::ostream&>() | ||
| 29 | - << std::declval<const T&>())> | ||
| 30 | - static void PrintValue(const T& value, ::std::ostream* os) { | ||
| 31 | + !std::is_member_pointer<T>::value>::type> | ||
| 32 | + // Only accept types for which we can find a streaming operator via | ||
| 33 | + // ADL (possibly involving implicit conversions). | ||
| 34 | + // (Use SFINAE via return type, because it seems GCC < 12 doesn't handle name | ||
| 35 | + // lookup properly when we do it in the template parameter list.) | ||
| 36 | + static auto PrintValue(const T& value, ::std::ostream* os) | ||
| 37 | + -> decltype((void)(*os << value)) { | ||
| 38 | // Call streaming operator found by ADL, possibly with implicit conversions | ||
| 39 | // of the arguments. | ||
| 40 | *os << value; | ||
| 41 | -- | ||
| 42 | 2.25.1 | ||
diff --git a/meta-oe/recipes-test/googletest/googletest_git.bb b/meta-oe/recipes-test/googletest/googletest_git.bb index 869c2c86b6..917a68e95b 100644 --- a/meta-oe/recipes-test/googletest/googletest_git.bb +++ b/meta-oe/recipes-test/googletest/googletest_git.bb | |||
| @@ -10,7 +10,8 @@ PROVIDES += "gmock gtest" | |||
| 10 | 10 | ||
| 11 | S = "${WORKDIR}/git" | 11 | S = "${WORKDIR}/git" |
| 12 | SRCREV = "9e712372214d75bb30ec2847a44bf124d48096f3" | 12 | SRCREV = "9e712372214d75bb30ec2847a44bf124d48096f3" |
| 13 | SRC_URI = "git://github.com/google/googletest.git;branch=main;protocol=https" | 13 | SRC_URI = "git://github.com/google/googletest.git;branch=main;protocol=https \ |
| 14 | file://0001-work-around-GCC-6-11-ADL-bug.patch " | ||
| 14 | 15 | ||
| 15 | inherit cmake | 16 | inherit cmake |
| 16 | 17 | ||
