public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59269] New: [4.9 Regression] ICE with reference in union
@ 2013-11-23 23:20 reichelt at gcc dot gnu.org
  2013-11-25  9:16 ` [Bug c++/59269] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-11-23 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59269
           Summary: [4.9 Regression] ICE with reference in union
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following invalid code snippet (compiled with "-std=c++11") triggers an ICE
on trunk:

===================
union U
{
  int& i = 0;
};

void foo()
{
  U();
}
===================

bug.cc:3:12: error: 'U::i' may not have reference type 'int&' because it is a
member of a union
   int& i = 0;
            ^
bug.cc:3:12: error: invalid initialization of non-const reference of type
'int&' from an rvalue of type 'int'
bug.cc: In function 'void foo()':
bug.cc:8:5: internal compiler error: in build_value_init_noctor, at
cp/init.c:385
   U();
     ^
0x6bccdf build_value_init_noctor(tree_node*, int)
        ../../gcc/gcc/cp/init.c:385
0x6bce4c build_value_init(tree_node*, int)
        ../../gcc/gcc/cp/init.c:364
0x606e6b build_functional_cast(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/typeck2.c:1858
0x66c0b5 cp_parser_functional_cast
        ../../gcc/gcc/cp/parser.c:23013
0x666930 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:5821
0x669148 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:7109
0x669ddf cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:7813
0x66a2d1 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:8051
0x66c254 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8213
0x66ca8e cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8252
0x66ca8e cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:9551
0x6625e8 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9402
0x663399 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:9674
0x66350e cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:9628
0x676bdb cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:18542
0x676bdb cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:18578
0x67aefe cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:22610
0x67bdbd cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:22522
0x67bdbd cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16522
0x67d05f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11134
Please submit a full bug report, [etc.]


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

* [Bug c++/59269] [4.9 Regression] ICE with reference in union
  2013-11-23 23:20 [Bug c++/59269] New: [4.9 Regression] ICE with reference in union reichelt at gcc dot gnu.org
@ 2013-11-25  9:16 ` rguenth at gcc dot gnu.org
  2014-01-17 11:23 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-25  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5
   Target Milestone|---                         |4.9.0


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

* [Bug c++/59269] [4.9 Regression] ICE with reference in union
  2013-11-23 23:20 [Bug c++/59269] New: [4.9 Regression] ICE with reference in union reichelt at gcc dot gnu.org
  2013-11-25  9:16 ` [Bug c++/59269] " rguenth at gcc dot gnu.org
@ 2014-01-17 11:23 ` paolo.carlini at oracle dot com
  2014-01-17 15:40 ` paolo at gcc dot gnu.org
  2014-01-17 15:43 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-01-17 11:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-01-17
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com
     Ever confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.


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

* [Bug c++/59269] [4.9 Regression] ICE with reference in union
  2013-11-23 23:20 [Bug c++/59269] New: [4.9 Regression] ICE with reference in union reichelt at gcc dot gnu.org
  2013-11-25  9:16 ` [Bug c++/59269] " rguenth at gcc dot gnu.org
  2014-01-17 11:23 ` paolo.carlini at oracle dot com
@ 2014-01-17 15:40 ` paolo at gcc dot gnu.org
  2014-01-17 15:43 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-01-17 15:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Fri Jan 17 15:40:13 2014
New Revision: 206718

URL: http://gcc.gnu.org/viewcvs?rev=206718&root=gcc&view=rev
Log:
/cp
2014-01-17  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/59269
    * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
    only when errorcount == 0.

/testsuite
2014-01-17  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/59269
    * g++.dg/cpp0x/nsdmi-union4.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-union4.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/init.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/59269] [4.9 Regression] ICE with reference in union
  2013-11-23 23:20 [Bug c++/59269] New: [4.9 Regression] ICE with reference in union reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-01-17 15:40 ` paolo at gcc dot gnu.org
@ 2014-01-17 15:43 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-01-17 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed.


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

end of thread, other threads:[~2014-01-17 15:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-23 23:20 [Bug c++/59269] New: [4.9 Regression] ICE with reference in union reichelt at gcc dot gnu.org
2013-11-25  9:16 ` [Bug c++/59269] " rguenth at gcc dot gnu.org
2014-01-17 11:23 ` paolo.carlini at oracle dot com
2014-01-17 15:40 ` paolo at gcc dot gnu.org
2014-01-17 15:43 ` 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).