public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64428] New: aggregate with const member as union member [C++03]
@ 2014-12-28 17:45 R.HL at gmx dot net
  2014-12-29  0:00 ` [Bug c++/64428] " redi at gcc dot gnu.org
  2014-12-29  2:27 ` R.HL at gmx dot net
  0 siblings, 2 replies; 3+ messages in thread
From: R.HL at gmx dot net @ 2014-12-28 17:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64428
           Summary: aggregate with const member as union member [C++03]
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: R.HL at gmx dot net

struct A
{
    const int b;
};

union U
{
    A a;
};

int main()
{
    U a = {1, 1};
}

Fails to compile using -std=c++03, although it should. Consider that no special
member function apart from the destructor is implicitly defined, and the
trivialty of them is preserved.


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

* [Bug c++/64428] aggregate with const member as union member [C++03]
  2014-12-28 17:45 [Bug c++/64428] New: aggregate with const member as union member [C++03] R.HL at gmx dot net
@ 2014-12-29  0:00 ` redi at gcc dot gnu.org
  2014-12-29  2:27 ` R.HL at gmx dot net
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-29  0:00 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is not valid C++03, and not even valid C++11 due to too many initializers
in the braced-init-list.


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

* [Bug c++/64428] aggregate with const member as union member [C++03]
  2014-12-28 17:45 [Bug c++/64428] New: aggregate with const member as union member [C++03] R.HL at gmx dot net
  2014-12-29  0:00 ` [Bug c++/64428] " redi at gcc dot gnu.org
@ 2014-12-29  2:27 ` R.HL at gmx dot net
  1 sibling, 0 replies; 3+ messages in thread
From: R.HL at gmx dot net @ 2014-12-29  2:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from R.HL at gmx dot net ---
That was a typo, I quickly modified the example before submitting it. It should
be

U u = {1};


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

end of thread, other threads:[~2014-12-29  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-28 17:45 [Bug c++/64428] New: aggregate with const member as union member [C++03] R.HL at gmx dot net
2014-12-29  0:00 ` [Bug c++/64428] " redi at gcc dot gnu.org
2014-12-29  2:27 ` R.HL at gmx dot net

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