public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array
@ 2014-02-17 21:34 reichelt at gcc dot gnu.org
  2014-02-17 21:35 ` [Bug c++/60251] " reichelt at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-17 21:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60251
           Summary: [4.9 Regression] [c++11] ICE capturing variable-length
                    array
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

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

====================================
void foo(int n)
{
  int x[n];
  [&x]() { decltype(x) y; };
}
====================================

bug.cc: In lambda function:
bug.cc:4:21: internal compiler error: in is_normal_capture_proxy, at
cp/lambda.c:258
   [&x]() { decltype(x) y; };
                     ^
0x7a28d0 is_normal_capture_proxy(tree_node*)
        ../../gcc/gcc/cp/lambda.c:258
0x7a69bc is_lambda_ignored_entity(tree_node*)
        ../../gcc/gcc/cp/lambda.c:1076
0x77b6ef qualify_lookup
        ../../gcc/gcc/cp/name-lookup.c:4270
0x7805fc lookup_name_real_1
        ../../gcc/gcc/cp/name-lookup.c:4798
0x7805fc lookup_name_real(tree_node*, int, int, bool, int, int)
        ../../gcc/gcc/cp/name-lookup.c:4883
0x6a1276 cp_parser_lookup_name
        ../../gcc/gcc/cp/parser.c:22231
0x6b37b2 cp_parser_lookup_name_simple
        ../../gcc/gcc/cp/parser.c:22294
0x6b37b2 cp_parser_decltype_expr
        ../../gcc/gcc/cp/parser.c:11854
0x6b37b2 cp_parser_decltype
        ../../gcc/gcc/cp/parser.c:12003
0x6cb40f cp_parser_simple_type_specifier
        ../../gcc/gcc/cp/parser.c:14533
0x6a942d cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14380
0x6c2b40 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11547
0x6c9739 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11137
0x6acc03 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11086
0x6add21 cp_parser_declaration_statement
        ../../gcc/gcc/cp/parser.c:10733
0x6ae36b cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9467
0x6af159 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:9745
0x6b07ce cp_parser_lambda_body
        ../../gcc/gcc/cp/parser.c:9249
0x6b07ce cp_parser_lambda_expression
        ../../gcc/gcc/cp/parser.c:8757
0x6b07ce cp_parser_primary_expression
        ../../gcc/gcc/cp/parser.c:4305
Please submit a full bug report, [etc.]

The code compiles fine, if I capture '[&]' instead of '[&x]'.


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

* [Bug c++/60251] [4.9 Regression] [c++11] ICE capturing variable-length array
  2014-02-17 21:34 [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array reichelt at gcc dot gnu.org
@ 2014-02-17 21:35 ` reichelt at gcc dot gnu.org
  2014-02-18  6:41 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-17 21:35 UTC (permalink / raw)
  To: gcc-bugs

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.5.0, 4.6.0, 4.7.0, 4.8.0
   Target Milestone|---                         |4.9.0
      Known to fail|                            |4.9.0


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

* [Bug c++/60251] [4.9 Regression] [c++11] ICE capturing variable-length array
  2014-02-17 21:34 [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array reichelt at gcc dot gnu.org
  2014-02-17 21:35 ` [Bug c++/60251] " reichelt at gcc dot gnu.org
@ 2014-02-18  6:41 ` jakub at gcc dot gnu.org
  2014-02-18  9:25 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-02-18  6:41 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-18
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r198745.


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

* [Bug c++/60251] [4.9 Regression] [c++11] ICE capturing variable-length array
  2014-02-17 21:34 [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array reichelt at gcc dot gnu.org
  2014-02-17 21:35 ` [Bug c++/60251] " reichelt at gcc dot gnu.org
  2014-02-18  6:41 ` jakub at gcc dot gnu.org
@ 2014-02-18  9:25 ` rguenth at gcc dot gnu.org
  2014-02-19 15:59 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-02-18  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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

* [Bug c++/60251] [4.9 Regression] [c++11] ICE capturing variable-length array
  2014-02-17 21:34 [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-02-18  9:25 ` rguenth at gcc dot gnu.org
@ 2014-02-19 15:59 ` paolo.carlini at oracle dot com
  2014-02-21  4:36 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-02-19 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Not sure this is valid. Anyway, the ICE is due to the COMPONENT_REF being
wrapped in a NOP_EXPR.


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

* [Bug c++/60251] [4.9 Regression] [c++11] ICE capturing variable-length array
  2014-02-17 21:34 [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-02-19 15:59 ` paolo.carlini at oracle dot com
@ 2014-02-21  4:36 ` jason at gcc dot gnu.org
  2014-02-21  4:37 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21  4:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org


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

* [Bug c++/60251] [4.9 Regression] [c++11] ICE capturing variable-length array
  2014-02-17 21:34 [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array reichelt at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-02-21  4:36 ` jason at gcc dot gnu.org
@ 2014-02-21  4:37 ` jason at gcc dot gnu.org
  2014-02-21 14:01 ` jason at gcc dot gnu.org
  2014-02-21 14:31 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21  4:37 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |ice-on-invalid-code

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
It's not valid.  The C++ VLA TS working paper (which was originally planned for
C++14) doesn't allow decltype of an array of runtime bound.


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

* [Bug c++/60251] [4.9 Regression] [c++11] ICE capturing variable-length array
  2014-02-17 21:34 [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array reichelt at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-02-21  4:37 ` jason at gcc dot gnu.org
@ 2014-02-21 14:01 ` jason at gcc dot gnu.org
  2014-02-21 14:31 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Feb 21 14:01:20 2014
New Revision: 207995

URL: http://gcc.gnu.org/viewcvs?rev=207995&root=gcc&view=rev
Log:
    PR c++/60251
    * lambda.c (is_normal_capture_proxy): Handle VLA capture.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1y/vla11.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/lambda.c


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

* [Bug c++/60251] [4.9 Regression] [c++11] ICE capturing variable-length array
  2014-02-17 21:34 [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array reichelt at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-02-21 14:01 ` jason at gcc dot gnu.org
@ 2014-02-21 14:31 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-02-21 14:31 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-02-21 14:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-17 21:34 [Bug c++/60251] New: [4.9 Regression] [c++11] ICE capturing variable-length array reichelt at gcc dot gnu.org
2014-02-17 21:35 ` [Bug c++/60251] " reichelt at gcc dot gnu.org
2014-02-18  6:41 ` jakub at gcc dot gnu.org
2014-02-18  9:25 ` rguenth at gcc dot gnu.org
2014-02-19 15:59 ` paolo.carlini at oracle dot com
2014-02-21  4:36 ` jason at gcc dot gnu.org
2014-02-21  4:37 ` jason at gcc dot gnu.org
2014-02-21 14:01 ` jason at gcc dot gnu.org
2014-02-21 14:31 ` jakub 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).