public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "priour.be at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/109366] New: No -Wanalyzer-null-dereference for unique_ptr
Date: Fri, 31 Mar 2023 22:11:55 +0000	[thread overview]
Message-ID: <bug-109366-4@http.gcc.gnu.org/bugzilla/> (raw)

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.

                 reply	other threads:[~2023-03-31 22:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109366-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).