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

            Bug ID: 119129
           Summary: ICE: in keep_template_parm, at cp/pt.cc:11115
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eczbek.void at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/3W514r5MP


```
template<typename T, int = 0> using A = decltype([] {});

template<typename T> requires(A<T>(), true) int x;

int main() { x<int>; }
```


```
Using built-in specs.
COLLECT_GCC=/opt/compiler-explorer/gcc-snapshot/bin/g++
Target: x86_64-linux-gnu
Configured with: ../gcc-trunk-20250305/configure
--prefix=/opt/compiler-explorer/gcc-build/staging
--enable-libstdcxx-backtrace=yes --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap
--enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --enable-clocale=gnu
--enable-languages=c,c++,fortran,ada,objc,obj-c++,go,d,rust,m2 --enable-ld=yes
--enable-gold=yes --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-linker-build-id --enable-lto --enable-plugins --enable-threads=posix
--with-pkgversion=Compiler-Explorer-Build-gcc-c49ef76dc78e4fd185f046d038c9692781d3b3e4-binutils-2.42
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.1 20250305 (experimental)
(Compiler-Explorer-Build-gcc-c49ef76dc78e4fd185f046d038c9692781d3b3e4-binutils-2.42)
 
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-g' '-o' '/app/output.s'
'-masm=intel' '-fno-verbose-asm' '-S' '-std=c++20' '-v' '-freport-bug'
'-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' '/app/'

/opt/compiler-explorer/gcc-trunk-20250305/bin/../libexec/gcc/x86_64-linux-gnu/15.0.1/cc1plus
-quiet -v -imultiarch x86_64-linux-gnu -iprefix
/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/
-D_GNU_SOURCE <source> -quiet -dumpdir /app/ -dumpbase output.cpp -dumpbase-ext
.cpp -masm=intel -mtune=generic -march=x86-64 -g -std=c++20 -version
-fdiagnostics-color=always -fno-verbose-asm -freport-bug -o /app/output.s
GNU C++20
(Compiler-Explorer-Build-gcc-c49ef76dc78e4fd185f046d038c9692781d3b3e4-binutils-2.42)
version 15.0.1 20250305 (experimental) (x86_64-linux-gnu)
        compiled by GNU C version 11.4.0, GMP version 6.2.1, MPFR version
4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../x86_64-linux-gnu/include"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/backward"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/include"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/include-fixed/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/include-fixed"
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1

/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/x86_64-linux-gnu

/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/../../../../include/c++/15.0.1/backward

/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/include

/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/include-fixed/x86_64-linux-gnu

/opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/x86_64-linux-gnu/15.0.1/include-fixed
 /usr/local/include
 /opt/compiler-explorer/gcc-trunk-20250305/bin/../lib/gcc/../../include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
Compiler executable checksum: 55b3176e04fb4d95492bc1dfefc3dcd6
<source>:5:14: internal compiler error: in keep_template_parm, at
cp/pt.cc:11115
    5 | int main() { x<int>; }
      |              ^~~~~~
0x291a065 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2931036 internal_error(char const*, ...)
        ???:0
0xacfe2a fancy_abort(char const*, int, char const*)
        ???:0
0x17f5aec walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x17f5aec walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x17f5aec walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x17f5aec walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x17f5aec walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x17f5b69 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x17f5d02 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0xd0aa92 find_template_parameters(tree_node*, tree_node*)
        ???:0
0xb594a8 constraints_satisfied_p(tree_node*, tree_node*)
        ???:0
0xd4702a finish_template_variable(tree_node*, int)
        ???:0
0xd82094 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned long)
        ???:0
0xcf1303 c_parse_file()
        ???:0
0xe53059 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Preprocessed source stored into /tmp/ccqmdIrJ.out file, please attach this to
your bugreport.
Compiler returned: 1
```

Reply via email to