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
This commit is contained in:
parent
b31202ca17
commit
45cb85f8c0
2 changed files with 6 additions and 0 deletions
|
@ -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; }
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue