public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iamanonymous.cs at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/115572] internal compiler error: in dependent_type_p, at cp/pt.cc:28020
Date: Fri, 21 Jun 2024 02:40:26 +0000	[thread overview]
Message-ID: <bug-115572-4-fsNx1Ki113@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115572-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Anonymous <iamanonymous.cs at gmail dot com> ---
*******************************************************************************
The compiler produces an internal error in lookup_template_class when compiling
the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

*******************************************************************************
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
*******************************************************************************
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
*******************************************************************************
Program:
# cat source_code_1.cpp

template <class... Ts>
auto f(Ts...) {
  [] { enum class e : Ts {}; };
}

int main() {
  f(0, true);
}


*******************************************************************************
Command Lines:
# g++ source_code_1.cpp  -std=c++2a -Wall -Wextra -pedantic
-fsanitize=undefined -fsanitize=address -O2 -c -o source_code_1.o
source_code_1.cpp: In instantiation of ‘auto f(Ts ...) [with Ts = {int,
bool}]’:
source_code_1.cpp:7:4:   required from here
    7 |   f(0, true);
      |   ~^~~~~~~~~
source_code_1.cpp:3:19: internal compiler error: in dependent_type_p, at
cp/pt.cc:28020
    3 |   [] { enum class e : Ts {}; };
      |                   ^
0x825d35 dependent_type_p(tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:28020
0xb55fd3 start_enum(tree_node*, tree_node*, tree_node*, tree_node*, bool,
bool*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:17113
0xcde80b lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:10268
0xcd2cd0 tsubst(tree_node*, tree_node*, int, tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:16265
0xccf2d4 tsubst_decl
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:15435
0xcc77e4 tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18541
0xcc6106 tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xcc6106 tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18424
0xcc6bee tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18797
0xce1718 tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xce1718 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:19850
0xcbe1a0 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:21757
0xcc4837 tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:19482
0xcc55cc tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18442
0xcc6106 tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xcc6106 tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18424
0xcc6bee tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18797
0xce0b52 tsubst_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xce0b52 instantiate_body
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:27107
0xcc4425 instantiate_decl(tree_node*, bool, bool)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:27392
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

*******************************************************************************

Also ICE on trunk, compiler explorer:https://godbolt.org/z/7aPr9fWxn

*******************************************************************************

  reply	other threads:[~2024-06-21  2:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-21  2:38 [Bug c++/115572] New: " iamanonymous.cs at gmail dot com
2024-06-21  2:40 ` iamanonymous.cs at gmail dot com [this message]
2024-06-26 16:39 ` [Bug c++/115572] ICE: " mpolacek at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-115572-4-fsNx1Ki113@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).