Bug 60230 - internal compiler error on lambdas capturing multidimensional arrays with dynamic boundary
Summary: internal compiler error on lambdas capturing multidimensional arrays with dyn...
Status: RESOLVED DUPLICATE of bug 84560
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: c++-lambda
: 64000 67608 69756 71628 (view as bug list)
Depends on:
Blocks: lambdas
  Show dependency treegraph
 
Reported: 2014-02-16 21:49 UTC by Arvin Moezzi
Modified: 2022-03-11 00:32 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-02-18 00:00:00


Attachments
preprocessed file foo.ii (235 bytes, text/plain)
2014-02-16 21:49 UTC, Arvin Moezzi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arvin Moezzi 2014-02-16 21:49:57 UTC
Created attachment 32145 [details]
preprocessed file foo.ii

With the following code snippet

<snip>
    void foo(const unsigned N)
    {
        int p[N][N];
        auto go = [&p] (void) { p[0][0] = -1; };
        go();
    }
</snip>

I get an internal compiler error.

#> /usr/local/bin/g++ --std=c++11 foo.cpp

foo.cpp: In lambda function:
foo.cpp:5:35: internal compiler error: in expand_expr_real_1, at expr.c:9459
     auto go = [&p] (void) { p[0][0] = -1; };
                                   ^



#> /usr/local/bin/g++ -v

Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=c,c++
Thread model: posix
gcc version 4.9.0 20140216 (experimental) (GCC)
Comment 1 Marek Polacek 2014-02-18 12:03:18 UTC
Started with r180707.
Comment 2 Paolo Carlini 2014-05-11 14:46:09 UTC
We should find the actual commit, likely *before* r180707.
Comment 3 Paolo Carlini 2017-10-04 09:26:19 UTC
*** Bug 71628 has been marked as a duplicate of this bug. ***
Comment 4 Paolo Carlini 2018-03-03 00:51:38 UTC
*** Bug 64000 has been marked as a duplicate of this bug. ***
Comment 5 Paolo Carlini 2018-03-03 00:56:47 UTC
*** Bug 69756 has been marked as a duplicate of this bug. ***
Comment 6 Paolo Carlini 2018-03-03 18:33:02 UTC
Jason, in 8, at variance with 7, for this testcase and its Dups we issue a proper error message mentioning N3639 and no ICE. I think we can resolve the bug, right?
Comment 7 Paolo Carlini 2018-03-05 10:44:47 UTC
*** Bug 67608 has been marked as a duplicate of this bug. ***
Comment 8 Jason Merrill 2018-03-05 20:07:06 UTC
(In reply to Paolo Carlini from comment #6)
> Jason, in 8, at variance with 7, for this testcase and its Dups we issue a
> proper error message mentioning N3639 and no ICE. I think we can resolve the
> bug, right?

Yes, my fix was marked with PR 84560.  Actually allowing this code would be an extension beyond what was allowed under the abandoned array TS.

*** This bug has been marked as a duplicate of bug 84560 ***