[gjs: 4/10] maint: Avoid bogus cppcheck warning with if constexpr
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 4/10] maint: Avoid bogus cppcheck warning with if constexpr
- Date: Mon, 25 Jul 2022 03:58:43 +0000 (UTC)
commit d6bfef269ac2f789b343048fae26d25a20439e0e
Author: Philip Chimento <philip chimento gmail com>
Date: Sat Jul 23 08:12:09 2022 -0700
maint: Avoid bogus cppcheck warning with if constexpr
This is tracked upstream in:
https://trac.cppcheck.net/ticket/10731
For the time being, work around it.
test/gjs-tests.cpp | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/test/gjs-tests.cpp b/test/gjs-tests.cpp
index d84c7c985..ecf986fbd 100644
--- a/test/gjs-tests.cpp
+++ b/test/gjs-tests.cpp
@@ -73,6 +73,9 @@ T get_random_number() {
} else if constexpr (std::is_pointer_v<T>) {
return reinterpret_cast<T>(get_random_number<uintptr_t>());
}
+
+ // COMPAT: Work around cppcheck bug https://trac.cppcheck.net/ticket/10731
+ g_assert_not_reached();
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]