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

            Bug ID: 125943
           Summary: constant evaluation doesn't detect uninitialized read
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

As shown in <https://godbolt.org/z/sceq85rMe>, all the other compilers reject
the second assert:

```
struct Int { int i; };
constexpr void BindReference() {
  Int a;
  Int const& b = a;
}
static_assert((BindReference(), true));

constexpr void Copy() {
  Int a;
  Int b = a;
}
static_assert((Copy(), true));
```

Reply via email to