Bug 103952 - [11/12/13/14 Regression] ICE: in cp_finish_decl, at cp/decl.c:7933
Summary: [11/12/13/14 Regression] ICE: in cp_finish_decl, at cp/decl.c:7933
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 12.0
: P4 trivial
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2022-01-09 14:51 UTC by 康桓瑋
Modified: 2024-04-13 20:14 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.9.1
Known to fail: 8.1.0
Last reconfirmed: 2024-04-13 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 康桓瑋 2022-01-09 14:51:44 UTC
12 regression:

template<class>
struct A {
  template<int... Is>
  struct B {
    static constexpr auto c = [] { return Is; }();
    using type = decltype(c);
  };
};

#include<tuple>
int main() {
  typename A<std::tuple<int>>::B<0>::type x;
}

https://godbolt.org/z/fxvKWP4qM
Comment 1 康桓瑋 2022-01-09 14:54:05 UTC
Segmentation fault:

template<class>
struct A {
  template<int... Is>
  static constexpr auto c = [] { return Is; }();
  using type = decltype(c<0>);
};

#include<tuple>
int main() {
  typename A<std::tuple<int>>::type x;
}

https://godbolt.org/z/EbdanW16d
Comment 2 Andrew Pinski 2022-01-09 16:31:01 UTC
I think they are two different bugs here, the first one was working (no ICE/confused by earlier errors, bailing out) in GCC 7.5.0 while the second one is was working in 4.9.1.
Comment 3 Richard Biener 2022-05-27 09:47:04 UTC
GCC 9 branch is being closed
Comment 4 Jakub Jelinek 2022-06-28 10:47:40 UTC
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
Comment 5 Richard Biener 2023-07-07 10:41:58 UTC
GCC 10 branch is being closed.
Comment 6 Andrew Pinski 2024-04-13 20:14:01 UTC
Note the first example in comment #0 was fixed in GCC 13. The one in comment #1 still fails on the trunk.