public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111159] New: [13 Regression] False positive -Wdangling-reference
@ 2023-08-25 23:21 daniel at constexpr dot org
  2023-08-25 23:26 ` [Bug c++/111159] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: daniel at constexpr dot org @ 2023-08-25 23:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111159
           Summary: [13 Regression] False positive -Wdangling-reference
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daniel at constexpr dot org
  Target Milestone: ---

GCC 13.2.0 as well as git from today report a false positive
-Wdangling-reference warning for the following C++ code:

struct A {
        int * i;
        int & b() { return *i; }
};

int g = 42;

A a() {
        return A{ &g };
}

int main() {
        const int & i = a().b();
        return i;
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-19 23:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25 23:21 [Bug c++/111159] New: [13 Regression] False positive -Wdangling-reference daniel at constexpr dot org
2023-08-25 23:26 ` [Bug c++/111159] " pinskia at gcc dot gnu.org
2023-08-28  7:19 ` [Bug c++/111159] [13/14 " rguenth at gcc dot gnu.org
2024-01-19 23:32 ` mpolacek at gcc dot gnu.org

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).