Bug 61046 - [4.8/4.9/4.10 Regression] ICE in lookup_field_1, at cp/search.c:384
Summary: [4.8/4.9/4.10 Regression] ICE in lookup_field_1, at cp/search.c:384
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.3
: P4 normal
Target Milestone: 5.0
Assignee: Jason Merrill
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2014-05-03 16:28 UTC by Matthias Klose
Modified: 2014-06-03 12:23 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.7.3
Known to fail: 4.8.2, 4.9.0
Last reconfirmed: 2014-06-03 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2014-05-03 16:28:35 UTC
4.7 rejects this without an ICE, the ICE is seen on 4.8, 4.9 branches and trunk.

$ cat tst.cc 
#include <array>
  const int i = 0;
  std::array<int, 1> bar = {
    [i] = 0
  };

$ g++-4.7 -Wall -std=gnu++0x tst.cc 
tst.cc:5:3: error: 'std::array<int, 1ul>' has no non-static data member named 'i'

$ g++-4.8 -Wall -std=gnu++0x tst.cc 
tst.cc:5:3: internal compiler error: in lookup_field_1, at cp/search.c:384
   };
   ^
Please submit a full bug report,
with preprocessed source if appropriate.
Comment 1 Richard Biener 2014-05-22 09:03:15 UTC
GCC 4.8.3 is being released, adjusting target milestone.
Comment 2 Jason Merrill 2014-06-03 04:58:12 UTC
Author: jason
Date: Tue Jun  3 04:57:39 2014
New Revision: 211160

URL: http://gcc.gnu.org/viewcvs?rev=211160&root=gcc&view=rev
Log:
	PR c++/61046
	* decl.c (reshape_init_class): Handle un-folded
	constant-expressions.

Added:
    trunk/gcc/testsuite/g++.dg/ext/desig7.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
Comment 3 Jason Merrill 2014-06-03 12:23:17 UTC
Fixed on trunk.