[Bug c++/102643] New: Segfault in alias template deduction

2021-10-07 Thread michael at cadilhac dot name via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102643

Bug ID: 102643
   Summary: Segfault in alias template deduction
   Product: gcc
   Version: 11.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: michael at cadilhac dot name
  Target Milestone: ---

Created attachment 51566
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51566&action=edit
File witnessing bug.

$ uname -a
Linux pin 5.14.7-arch1-1 #1 SMP PREEMPT Wed, 22 Sep 2021 21:35:11 + x86_64
GNU/Linux
$ g++ --version
g++ (GCC) 11.1.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ bug.cc -std=c++20 
In file included from /usr/include/c++/11.1.0/vector:67,
 from bug.cc:1:
/usr/include/c++/11.1.0/bits/stl_vector.h: In function
‘vector(std::initializer_list<_Tp>, const std::allocator<_Up>&)->
std::vector [with T = char]’:
/usr/include/c++/11.1.0/bits/stl_vector.h:626:42: internal compiler error:
Segmentation fault
  626 |  const allocator_type& __a = allocator_type())
  |  ^~~~
0x1797368 internal_error(char const*, ...)
???:0
0x7e73b1 tsubst(tree_node*, tree_node*, int, tree_node*)
???:0
0x7fa400 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
???:0
0x7e875d tsubst(tree_node*, tree_node*, int, tree_node*)
???:0
0x7fc222 tsubst_default_argument(tree_node*, int, tree_node*, tree_node*, int)
???:0
0x68bb2b convert_default_arg(tree_node*, tree_node*, tree_node*, int, int)
???:0
0x69950a build_new_function_call(tree_node*, vec**, int)
???:0
0x7e0ba8 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
???:0
0x851e94 build_functional_cast(unsigned int, tree_node*, tree_node*, int)
???:0
0x7ce2fe c_parse_file()
???:0
0x8a252d c_common_parse_file()
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
$

[Bug c++/116477] New: ICE in instantiate_decl, instead of "cannot use concept as function"

2024-08-24 Thread michael at cadilhac dot name via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116477

Bug ID: 116477
   Summary: ICE in instantiate_decl, instead of "cannot use
concept as function"
   Product: gcc
   Version: 14.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: michael at cadilhac dot name
  Target Milestone: ---

This appears from 10.1 to current trunk, according to Godbolt.

Source:

--- file.cc

#include 

template 
bool run () {
return std::regular (G{});
}

int main () {
  run ();
}
---

Compile:

---
$ g++ --version
g++ (GCC) 14.2.1 20240805
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ file.cc -std=c++20
b.cc: In instantiation of ‘bool run() [with G = int]’:
b.cc:9:12:   required from here
9 |   run ();
  |   ~^~
b.cc:5:28: internal compiler error: in tsubst_expr, at cp/pt.cc:21118
5 | return std::regular (G{});
  |^
0x21a7bea internal_error(char const*, ...)
???:0
0x703e99 fancy_abort(char const*, int, char const*)
???:0
0x8ca115 instantiate_decl(tree_node*, bool, bool)
???:0
0x8f0103 instantiate_pending_templates(int)
???:0
0x7ce561 c_parse_final_cleanups()
???:0
0x9cc18a c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See 
for instructions.
$ 
---