public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106788] New: GCC rejects valid program involving initialization of array in member initializer list
@ 2022-08-31 12:11 jlame646 at gmail dot com
  2022-08-31 12:13 ` [Bug c++/106788] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jlame646 at gmail dot com @ 2022-08-31 12:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106788
           Summary: GCC rejects valid program involving initialization of
                    array in member initializer list
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

The following valid program is rejected by gcc 9.3 but accepted by gcc 9.4 and
onwards. Demo link: https://godbolt.org/z/KT3GWP677

```

struct A {
  A(int aa) : a(aa) {}

  A(const A &a) = delete;
  A &operator=(const A &a) = delete;

private:
  int a;
  std::vector<int> v;
};


struct B2 {
  B2()
    : a2{{1}, {2}} // -> error: use of deleted function 'A::A(const A&)' (gcc
9.3)
  {} 

private:
  A a2[2];
};

```

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

end of thread, other threads:[~2022-08-31 12:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 12:11 [Bug c++/106788] New: GCC rejects valid program involving initialization of array in member initializer list jlame646 at gmail dot com
2022-08-31 12:13 ` [Bug c++/106788] " rguenth at gcc dot gnu.org
2022-08-31 12:28 ` marxin at gcc dot gnu.org
2022-08-31 12:49 ` redi 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).