public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54998] New: Internal compiler error with union member initialization using default constructor
@ 2012-10-20 12:25 tobias.anderberg at gmail dot com
  2012-10-20 23:03 ` [Bug c++/54998] " paolo.carlini at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tobias.anderberg at gmail dot com @ 2012-10-20 12:25 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54998

             Bug #: 54998
           Summary: Internal compiler error with union member
                    initialization using default constructor
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tobias.anderberg@gmail.com


class Foo {
public:
private:
    static const int kRows = 4;
    static const int kCols = 4;

    union {
        float m_n[kRows][kCols];
        float m_m[kRows * kCols] = {
            1.0f, 0.0f, 0.0f, 0.0f,
            0.0f, 1.0f, 0.0f, 0.0f,
            0.0f, 0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 0.0f, 1.0f
        };
    };
};

int main()
{
    Foo myFoo;
    return 0;
}

Compile: g++ -std=c++11 foo.cc

Result:

foo.cc: In constructor ‘constexpr Foo::Foo()’:
foo.cc:1:7: internal compiler error: in cx_check_missing_mem_inits, at
cp/semantics.c:6166
 class Foo {
       ^

foo.cc:1:7: internal compiler error: Abort trap: 6
g++: internal compiler error: Abort trap: 6 (program cc1plus)
Abort trap: 6

System:
Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012;
root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64

GCC build command: ./configure --enable-languages=c,c++

g++ --version
g++ (GCC) 4.8.0 20121020 (experimental)

Additional notes:
By either naming the union, or supplying a default constructor the sample
compiles.


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

* [Bug c++/54998] Internal compiler error with union member initialization using default constructor
  2012-10-20 12:25 [Bug c++/54998] New: Internal compiler error with union member initialization using default constructor tobias.anderberg at gmail dot com
@ 2012-10-20 23:03 ` paolo.carlini at oracle dot com
  2013-07-04 10:12 ` paolo.carlini at oracle dot com
  2013-07-04 10:27 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-20 23:03 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54998

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal


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

* [Bug c++/54998] Internal compiler error with union member initialization using default constructor
  2012-10-20 12:25 [Bug c++/54998] New: Internal compiler error with union member initialization using default constructor tobias.anderberg at gmail dot com
  2012-10-20 23:03 ` [Bug c++/54998] " paolo.carlini at oracle dot com
@ 2013-07-04 10:12 ` paolo.carlini at oracle dot com
  2013-07-04 10:27 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-04 10:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54998

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This is fixed in mainline. I'm adding the testcase and closing the bug.


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

* [Bug c++/54998] Internal compiler error with union member initialization using default constructor
  2012-10-20 12:25 [Bug c++/54998] New: Internal compiler error with union member initialization using default constructor tobias.anderberg at gmail dot com
  2012-10-20 23:03 ` [Bug c++/54998] " paolo.carlini at oracle dot com
  2013-07-04 10:12 ` paolo.carlini at oracle dot com
@ 2013-07-04 10:27 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-04 10:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54998

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |4.9.0
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0
      Known to fail|                            |4.8.1

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Done.


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

end of thread, other threads:[~2013-07-04 10:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-20 12:25 [Bug c++/54998] New: Internal compiler error with union member initialization using default constructor tobias.anderberg at gmail dot com
2012-10-20 23:03 ` [Bug c++/54998] " paolo.carlini at oracle dot com
2013-07-04 10:12 ` paolo.carlini at oracle dot com
2013-07-04 10:27 ` paolo.carlini at oracle dot com

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