public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95317] New: [7 regression] ICE on valid C++14 code, in tsubst_copy, at cp/pt.c:15649
@ 2020-05-25 16:21 fxcoudert at gcc dot gnu.org
  2020-05-26  7:18 ` [Bug c++/95317] [8/9/10/11 Regression] " rguenth at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2020-05-25 16:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95317

            Bug ID: 95317
           Summary: [7 regression] ICE on valid C++14 code, in
                    tsubst_copy, at cp/pt.c:15649
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org
  Target Milestone: ---

ICE on valid C++14 code:

$ cat b.C
#include <iostream>

template <int I>
struct num
{
    enum { value = I };
};

#define VALUEOFNUM(x) std::remove_reference_t<decltype(x)>::value


template <typename TYPE>
void foo()
{
    auto test = [&](auto i)
    {
        enum { VALUE = VALUEOFNUM(i) };
        std::cout << VALUE;
    };

    test(num<0>());
    test(num<1>());
}

int main()
{
    foo<void>();
}

$ g++-9 b.C 
b.C: In instantiation of 'void foo() [with TYPE = void]':
b.C:27:15:   required from here
b.C:18:22: internal compiler error: in tsubst_copy, at cp/pt.c:15649
   18 |         std::cout << VALUE;
      |                      ^~~~~
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://github.com/Homebrew/homebrew-core/issues> for instructions.



Works fine with GCC up to version 6, but regresses at 7 and later.

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

end of thread, other threads:[~2023-07-07  8:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 16:21 [Bug c++/95317] New: [7 regression] ICE on valid C++14 code, in tsubst_copy, at cp/pt.c:15649 fxcoudert at gcc dot gnu.org
2020-05-26  7:18 ` [Bug c++/95317] [8/9/10/11 Regression] " rguenth at gcc dot gnu.org
2020-05-26  7:26 ` marxin at gcc dot gnu.org
2020-05-26  7:43 ` marxin at gcc dot gnu.org
2021-01-14  8:53 ` rguenth at gcc dot gnu.org
2021-04-05 19:39 ` cvs-commit at gcc dot gnu.org
2021-04-05 19:40 ` [Bug c++/95317] [8/9/10 " jason at gcc dot gnu.org
2021-04-26 16:29 ` mpolacek at gcc dot gnu.org
2021-05-14  9:53 ` [Bug c++/95317] [9/10 " jakub at gcc dot gnu.org
2021-06-01  8:17 ` rguenth at gcc dot gnu.org
2021-10-01 10:35 ` pinskia at gcc dot gnu.org
2022-05-27  9:42 ` [Bug c++/95317] [10 " rguenth at gcc dot gnu.org
2022-06-28 10:40 ` jakub at gcc dot gnu.org
2023-07-07  8:53 ` rguenth 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).