summaryrefslogtreecommitdiff
path: root/dev-cpp/glog/files/glog-0.6.0-try-fix-logging-test.patch
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2024-11-28 23:05:10 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2024-11-28 23:05:29 +0100
commit5c1744bb015d407629860df1065037870ebfb034 (patch)
tree1a602aaef2be1297e5cf96b4d6e4a4cae7d3342c /dev-cpp/glog/files/glog-0.6.0-try-fix-logging-test.patch
parentd3581e20b3f527c7e7946cb050292bb3676bebac (diff)
downloadgentoo-5c1744bb015d407629860df1065037870ebfb034.tar.gz
gentoo-5c1744bb015d407629860df1065037870ebfb034.tar.bz2
gentoo-5c1744bb015d407629860df1065037870ebfb034.zip
dev-cpp/glog: Disable broken symbolize patch, try fix logging test
Closes: https://bugs.gentoo.org/863599 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'dev-cpp/glog/files/glog-0.6.0-try-fix-logging-test.patch')
-rw-r--r--dev-cpp/glog/files/glog-0.6.0-try-fix-logging-test.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/dev-cpp/glog/files/glog-0.6.0-try-fix-logging-test.patch b/dev-cpp/glog/files/glog-0.6.0-try-fix-logging-test.patch
new file mode 100644
index 000000000000..b3bec4801f28
--- /dev/null
+++ b/dev-cpp/glog/files/glog-0.6.0-try-fix-logging-test.patch
@@ -0,0 +1,36 @@
+From 45d7978dafceca8200fa4434d762f62642dc7cb4 Mon Sep 17 00:00:00 2001
+From: Sergiu Deitsch <sergiud@users.noreply.github.com>
+Date: Tue, 2 Jan 2024 13:01:42 +0100
+Subject: [PATCH] fix(tests): prevent clang from optimizing new away (#1017)
+
+---
+ src/logging_unittest.cc | 13 +++++++++++--
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/src/logging_unittest.cc b/src/logging_unittest.cc
+index cb1c657e7..40da9a44d 100644
+--- a/src/logging_unittest.cc
++++ b/src/logging_unittest.cc
+@@ -355,12 +355,19 @@ struct NewHook {
+ }
+ };
+
++namespace {
++int* allocInt() { return new int; }
++} // namespace
++
+ TEST(DeathNoAllocNewHook, logging) {
+ // tests that NewHook used below works
+ NewHook new_hook;
+- ASSERT_DEATH({
+- new int;
+- }, "unexpected new");
++ // Avoid unused warnings under MinGW
++ //
++ // NOTE MSVC produces warning C4551 here if we do not take the address of the
++ // function explicitly.
++ (void)&allocInt;
++ ASSERT_DEATH({ allocInt(); }, "unexpected new");
+ }
+
+ void TestRawLogging() {