Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45cb85f8 authored by Yi Kong's avatar Yi Kong
Browse files

Suppress null-dereference warning

It is unclear whether author intentionally meant to cause segfault here.
While waiting for the author to explain/fix the code, suppress the
warning to unblock enabling the warning globally.

Test: m checkbuild
Bug: 121390225
Change-Id: Iad03842833cfdc243404a32f6b31d161387c3890
parent b31202ca
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -274,7 +274,10 @@ inline KeyParameter Authorization(TypedTag<tag_type, tag> ttag, Args&&... args)
 */
template <typename ValueT> class NullOr {
    template <typename T> struct reference_initializer {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnull-dereference"
        static T&& init() { return *static_cast<std::remove_reference_t<T>*>(nullptr); }
#pragma GCC diagnostic pop
    };
    template <typename T> struct pointer_initializer {
        static T init() { return nullptr; }
+3 −0
Original line number Diff line number Diff line
@@ -282,7 +282,10 @@ template <typename ValueT>
class NullOr {
    template <typename T>
    struct reference_initializer {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnull-dereference"
        static T&& init() { return *static_cast<std::remove_reference_t<T>*>(nullptr); }
#pragma GCC diagnostic pop
    };
    template <typename T>
    struct pointer_initializer {