[Bug c++/93639] [c++2a] Segfault on non type template parameter and consteval (master)

2020-02-13 Thread raphael.grimm at kit dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93639

--- Comment #4 from raphael grimm  ---
Created attachment 47835
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47835=edit
reduced to 11 lines and no includes

http://coliru.stacked-crooked.com/a/be3bbfdf6a59b45e

on g++ (GCC) 9.2.0

output:

main.cpp:8:26: internal compiler error: Segmentation fault
8 | using type = B;
  |  ^
0xb5c5ff crash_signal
../.././gcc/toplev.c:326
0x5cb5c3 resolve_args
../.././gcc/cp/call.c:4350
0x5da0c7 build_new_function_call(tree_node*, vec**, int)
../.././gcc/cp/call.c:4469
0x6bbeaf do_class_deduction
../.././gcc/cp/pt.c:27497
0x6bbeaf do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
../.././gcc/cp/pt.c:27556
0x6c492d convert_template_argument
../.././gcc/cp/pt.c:8086
0x6c492d convert_template_argument
../.././gcc/cp/pt.c:7859
0x6cf795 coerce_template_parms
../.././gcc/cp/pt.c:8589
0x6d0b2a lookup_template_class_1
../.././gcc/cp/pt.c:9399
0x6d0b2a lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../.././gcc/cp/pt.c:9769
0x6ebe5d finish_template_type(tree_node*, tree_node*, int)
../.././gcc/cp/semantics.c:3312
0x6929c5 cp_parser_template_id
../.././gcc/cp/parser.c:16481
0x692b07 cp_parser_class_name
../.././gcc/cp/parser.c:23276
0x695790 cp_parser_qualifying_entity
../.././gcc/cp/parser.c:6696
0x695790 cp_parser_nested_name_specifier_opt
../.././gcc/cp/parser.c:6382
0x6931f5 cp_parser_simple_type_specifier
../.././gcc/cp/parser.c:17839
0x68a1a5 cp_parser_type_specifier
../.././gcc/cp/parser.c:17507
0x69d118 cp_parser_type_specifier_seq
../.././gcc/cp/parser.c:21985
0x69a4b4 cp_parser_type_id_1
../.././gcc/cp/parser.c:21814
0x69e902 cp_parser_type_id
../.././gcc/cp/parser.c:21893
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++/93639] [c++2a] Segfault on non type template parameter and consteval (master)

2020-02-09 Thread raphael.grimm at kit dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93639

--- Comment #2 from raphael grimm  ---
Created attachment 47804
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47804=edit
more minimal example also causing this error

test.cpp:23:28: internal compiler error: Segmentation fault
   23 | using type = a;
  |^
0xc8980f crash_signal
/home/raphael/repos/build-gcc/gcc/gcc/toplev.c:328
0x673d73 resolve_args(vec*, int)
/home/raphael/repos/build-gcc/gcc/gcc/cp/call.c:4431
0x78513c do_class_deduction
/home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:28599
0x78513c do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
/home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:28732
0x7865cd convert_template_argument
/home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:8309
0x798db7 convert_template_argument
/home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:8082
0x798db7 coerce_template_parms
/home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:8813
0x79cbd9 lookup_template_class_1
/home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:9668
0x79dedc lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
/home/raphael/repos/build-gcc/gcc/gcc/cp/pt.c:10040
0x7b925d finish_template_type(tree_node*, tree_node*, int)
/home/raphael/repos/build-gcc/gcc/gcc/cp/semantics.c:3407
0x762265 cp_parser_template_id
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:16681
0x7624b7 cp_parser_class_name
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:23618
0x75f2e1 cp_parser_qualifying_entity
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:6738
0x75f2e1 cp_parser_nested_name_specifier_opt
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:6410
0x71 cp_parser_simple_type_specifier
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:18076
0x74d46c cp_parser_type_specifier
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:17734
0x760af2 cp_parser_type_specifier_seq
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:22307
0x75adb4 cp_parser_type_id_1
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:22124
0x75bf58 cp_parser_type_id
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:22203
0x75bf58 cp_parser_alias_declaration
/home/raphael/repos/build-gcc/gcc/gcc/cp/parser.c:19949
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++/93639] [c++2a] Segfault on non type template parameter and consteval (master)

2020-02-09 Thread raphael.grimm at kit dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93639

--- Comment #1 from raphael grimm  ---
Created attachment 47803
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47803=edit
ii file

[Bug c++/93639] New: [c++2a] Segfault on non type template parameter and consteval (master)

2020-02-09 Thread raphael.grimm at kit dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93639

Bug ID: 93639
   Summary: [c++2a] Segfault on non type template parameter and
consteval (master)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: raphael.grimm at kit dot edu
  Target Milestone: ---

Created attachment 47802
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47802=edit
source

I played around with some new features and encountered a segfault:

the exact version of GCC: 
commit b780f68e025b2cf5631183e199ebf672ea463af6

the system type:
$ uname -a
Linux i61nb061 4.15.0-76-generic #86-Ubuntu SMP Fri Jan 17 17:24:28 UTC
2020 x86_64 x86_64 x86_64 GNU/Linux

the options given when GCC was configured/built;
./configure"  \
-v  \
--build=x86_64-linux-gnu\
--host=x86_64-linux-gnu \
--target=x86_64-linux-gnu   \
--prefix="$install_dir" \
--enable-checking=release   \
--enable-languages=c,c++,fortran\
--disable-multilib  \
--program-suffix="-b780f68e025b2cf5631183e199ebf672ea463af6"


the complete command line that triggers the bug;
$ gcc-master test.cpp -std=c++2a -save-temps

the compiler output (error messages, warnings, etc.);
test.cpp:25:26: internal compiler error: Segmentation fault
   25 | using type = a;
  |  ^
0xc8980f crash_signal
/home/username/repos/build-gcc/gcc/gcc/toplev.c:328
0x673d73 resolve_args(vec*, int)
/home/username/repos/build-gcc/gcc/gcc/cp/call.c:4431
0x78513c do_class_deduction
/home/username/repos/build-gcc/gcc/gcc/cp/pt.c:28599
0x78513c do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
/home/username/repos/build-gcc/gcc/gcc/cp/pt.c:28732
0x7865cd convert_template_argument
/home/username/repos/build-gcc/gcc/gcc/cp/pt.c:8309
0x798db7 convert_template_argument
/home/username/repos/build-gcc/gcc/gcc/cp/pt.c:8082
0x798db7 coerce_template_parms
/home/username/repos/build-gcc/gcc/gcc/cp/pt.c:8813
0x79cbd9 lookup_template_class_1
/home/username/repos/build-gcc/gcc/gcc/cp/pt.c:9668
0x79dedc lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
/home/username/repos/build-gcc/gcc/gcc/cp/pt.c:10040
0x7b925d finish_template_type(tree_node*, tree_node*, int)
/home/username/repos/build-gcc/gcc/gcc/cp/semantics.c:3407
0x762265 cp_parser_template_id
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:16681
0x7624b7 cp_parser_class_name
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:23618
0x75f2e1 cp_parser_qualifying_entity
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:6738
0x75f2e1 cp_parser_nested_name_specifier_opt
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:6410
0x71 cp_parser_simple_type_specifier
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:18076
0x74d46c cp_parser_type_specifier
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:17734
0x760af2 cp_parser_type_specifier_seq
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:22307
0x75adb4 cp_parser_type_id_1
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:22124
0x75bf58 cp_parser_type_id
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:22203
0x75bf58 cp_parser_alias_declaration
/home/username/repos/build-gcc/gcc/gcc/cp/parser.c:19949
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.