mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
Merge "Suppress null-dereference warning" am: 3b7ecd55f8
am: 86f9078b54
Change-Id: Iff805b933dbddfaae22de3ef34caa8b391dedfe9
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user