public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/109366] New: No -Wanalyzer-null-dereference for unique_ptr
@ 2023-03-31 22:11 priour.be at gmail dot com
  0 siblings, 0 replies; only message in thread
From: priour.be at gmail dot com @ 2023-03-31 22:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109366

            Bug ID: 109366
           Summary: No -Wanalyzer-null-dereference for unique_ptr
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: priour.be at gmail dot com
                CC: priour.be at gmail dot com
  Target Milestone: ---
            Target: x86_64-pc-linux-gnu
             Build: 13.0.1 20230328 (experimental)

Created attachment 54800
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54800&action=edit
Preprocessed reproducer

While shared_ptr does, the usage of unique_ptrs doesn't lead to the expected
-Wanalyzer-null-dereference diagnostic.

// Preprocessed source in attachment.
#include <memory>

struct A {int x; int y;};
int main() {
    std::unique_ptr<A> a;
    a->x = 12;
   return 0;
} 

bin/g++ -v --save-temps -S -fanalyzer -Wanalyzer-null-dereference
-Wanalyzer-possible-null-dereference -fanalyzer-fine-grained
null_dereference_unique_ptr_test.cpp

No diagnostics are issued.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-31 22:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 22:11 [Bug analyzer/109366] New: No -Wanalyzer-null-dereference for unique_ptr priour.be at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).