[Bug c++/82085] [6 Regression] ICE: Template variable reference used in nested template alias

2018-10-26 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82085

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|6.5 |7.3

--- Comment #14 from Jakub Jelinek  ---
GCC 6 branch is being closed, fixed in 7.x.

[Bug c++/82085] [6 Regression] ICE: Template variable reference used in nested template alias

2017-10-31 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82085

--- Comment #13 from Paolo Carlini  ---
Thanks!

[Bug c++/82085] [6 Regression] ICE: Template variable reference used in nested template alias

2017-10-31 Thread rbock at eudoxos dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82085

--- Comment #12 from Roland B  ---
Done, reported as bug 82782. Thanks for your help!

[Bug c++/82085] [6 Regression] ICE: Template variable reference used in nested template alias

2017-10-31 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82085

--- Comment #11 from Paolo Carlini  ---
Just to clarify why I think a separate bug report is more appropriate: if I
revert the small change I committed for this bug, the new testcase does *not*
trigger the ICE fixed here.

[Bug c++/82085] [6 Regression] ICE: Template variable reference used in nested template alias

2017-10-31 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82085

--- Comment #10 from Paolo Carlini  ---
Yes, please, open a new bug, it's a different issue.

[Bug c++/82085] [6 Regression] ICE: Template variable reference used in nested template alias

2017-10-31 Thread rbock at eudoxos dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82085

--- Comment #9 from Roland B  ---
Here is the new minimal example (please let me know if this should go into a
new bug report):

// -
template 
struct make_char_sequence;

template 
struct make_char_sequence
{
  using type = int;
};

template 
using make_char_sequence_t = typename make_char_sequence::type;

inline constexpr char sample[] = "Sample";

using X = make_char_sequence_t;
// -

g++ (GCC) 8.0.0 20171030 (experimental)

test.cpp: In substitution of ‘template using
make_char_sequence_t = typename make_char_sequence::type [with const auto&
StringLiteral = sample]’:
test.cpp:15:38:   required from here
test.cpp:11:78: internal compiler error: unexpected expression ‘N’ of kind
template_parm_index
 using make_char_sequence_t = typename make_char_sequence::type;
  ^
0x6bd33a cxx_eval_constant_expression
../../gcc-trunk/gcc/cp/constexpr.c:4638
0x6c197d cxx_eval_outermost_constant_expr
../../gcc-trunk/gcc/cp/constexpr.c:4697
0x6c4c46 maybe_constant_value(tree_node*, tree_node*)
../../gcc-trunk/gcc/cp/constexpr.c:4912
0x7198b4 compute_array_index_type(tree_node*, tree_node*, int)
../../gcc-trunk/gcc/cp/decl.c:9349
0x833768 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc-trunk/gcc/cp/pt.c:13680
0x833538 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc-trunk/gcc/cp/pt.c:14137
0x83312b tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc-trunk/gcc/cp/pt.c:13626
0x82e7f5 unify
../../gcc-trunk/gcc/cp/pt.c:20908
0x82f40f unify
../../gcc-trunk/gcc/cp/pt.c:21328
0x82f1e7 unify
../../gcc-trunk/gcc/cp/pt.c:21100
0x830232 get_partial_spec_bindings
../../gcc-trunk/gcc/cp/pt.c:21906
0x830ab1 most_specialized_partial_spec
../../gcc-trunk/gcc/cp/pt.c:22178
0x858107 instantiate_class_template_1
../../gcc-trunk/gcc/cp/pt.c:10341
0x858107 instantiate_class_template(tree_node*)
../../gcc-trunk/gcc/cp/pt.c:10909
0x8b12a2 complete_type(tree_node*)
../../gcc-trunk/gcc/cp/typeck.c:136
0x83403f tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc-trunk/gcc/cp/pt.c:14208
0x83dec6 tsubst_decl
../../gcc-trunk/gcc/cp/pt.c:13043
0x833e17 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc-trunk/gcc/cp/pt.c:13553
0x83130d instantiate_template_1
../../gcc-trunk/gcc/cp/pt.c:18502
0x83130d instantiate_template(tree_node*, tree_node*, int)
../../gcc-trunk/gcc/cp/pt.c:18558

[Bug c++/82085] [6 Regression] ICE: Template variable reference used in nested template alias

2017-10-31 Thread rbock at eudoxos dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82085

--- Comment #8 from Roland B  ---
(In reply to Paolo Carlini from comment #7)
> Fixed trunk and 7.3.0 so far.

Awesome!

Sadly, my "real" code still produces an internal compile error. I will try to
create a new minimal example.

Until then, you can observe the code here:
https://github.com/rbock/sqlpp17/tree/1c424f9c1e4d9d9fa7e1c0cb48d27aec190f0da7

And then something like:
export SOURCE_ROOT=$HOME/projects/sqlpp17
/usr/local/gcc-trunk/bin/g++-I$SOURCE_ROOT/include -I$SOURCE_ROOT/tests 
-std=c++1z -Wall -Wpedantic $SOURCE_ROOT/tests/serialize/join.cpp

This creates:
sqlpp17/char_sequence.h:70:80: internal compiler error: unexpected expression
‘N’ of kind template_parm_index
   using make_char_sequence_t = typename
make_char_sequence::type;
   
^
0x6bd33a cxx_eval_constant_expression
../../gcc-trunk/gcc/cp/constexpr.c:4638
...

[Bug c++/82085] [6 Regression] ICE: Template variable reference used in nested template alias

2017-10-30 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82085

Paolo Carlini  changed:

   What|Removed |Added

Summary|[6/7/8 Regression] ICE: |[6 Regression] ICE:
   |Template variable reference |Template variable reference
   |used in nested template |used in nested template
   |alias   |alias

--- Comment #7 from Paolo Carlini  ---
Fixed trunk and 7.3.0 so far.