File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ class shared_ref
7373 explicit shared_ref (std::shared_ptr<object_type> ptr) :
7474 p(std::move(ptr))
7575 {
76- ASSERT (this ->p )
76+ utki::assert (this ->p , SL );
7777 }
7878
7979public:
@@ -102,7 +102,7 @@ class shared_ref
102102 shared_ref (const shared_ref<other_object_type>& sr) noexcept :
103103 p (sr.to_shared_ptr())
104104 {
105- ASSERT (this ->p )
105+ utki::assert (this ->p , SL );
106106 }
107107
108108 /* *
@@ -156,8 +156,18 @@ class shared_ref
156156 */
157157 constexpr object_type& get () const noexcept
158158 {
159- ASSERT (this ->p )
159+ utki::assert (this ->p , SL );
160+
161+ // In GCC 14.2 with -O3 and -g3, the compiler is not able to figure out that this->p is always initialized.
162+ // So, we suppress the warning.
163+ #if CFG_COMPILER == CFG_COMPILER_GCC && CFG_COMPILER_VERSION_MAJOR == 14 && CFG_COMPILER_VERSION_MINOR == 2
164+ # pragma GCC diagnostic push
165+ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
166+ #endif
160167 return *this ->p ;
168+ #if CFG_COMPILER == CFG_COMPILER_GCC && CFG_COMPILER_VERSION_MAJOR == 14 && CFG_COMPILER_VERSION_MINOR == 2
169+ # pragma GCC diagnostic pop
170+ #endif
161171 }
162172
163173 /* *
You can’t perform that action at this time.
0 commit comments