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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Comment 7 now ICEs in a different spot.  This started with r13-4761:

commit 982629bea416df976686467f235e09cb1a5531cc
Author: Patrick Palka <ppa...@redhat.com>
Date:   Sat Dec 17 11:24:44 2022 -0500

    c++: constantness of non-dependent NTTP argument [PR107437]


$ xg++ -c 83529-2.C 
83529-2.C:5:26: error: call to non-‘constexpr’ function ‘int Foo(void*)’
    5 | template <int I> TPL<Foo (I)> Baz ();
      |                      ~~~~^~~
83529-2.C:1:5: note: ‘int Foo(void*)’ declared here
    1 | int Foo (void *);
      |     ^~~
83529-2.C:5:26: error: invalid conversion from ‘int’ to ‘void*’ [-fpermissive]
    5 | template <int I> TPL<Foo (I)> Baz ();
      |                      ~~~~^~~
      |                          |
      |                          int
83529-2.C:1:10: note:   initializing argument 1 of ‘int Foo(void*)’
    1 | int Foo (void *);
      |          ^~~~~~
83529-2.C:5:26: error: call to non-‘constexpr’ function ‘int Foo(void*)’
    5 | template <int I> TPL<Foo (I)> Baz ();
      |                      ~~~~^~~
83529-2.C:1:5: note: ‘int Foo(void*)’ declared here
    1 | int Foo (void *);
      |     ^~~
83529-2.C:5:26: note: in template argument for type ‘int’
    5 | template <int I> TPL<Foo (I)> Baz ();
      |                      ~~~~^~~
83529-2.C:9:26: error: call to non-‘constexpr’ function ‘int Foo(float)’
    9 | template <int I> TPL<Foo (I)> Baz ();
      |                      ~~~~^~~
83529-2.C:7:5: note: ‘int Foo(float)’ declared here
    7 | int Foo (float);
      |     ^~~
83529-2.C:9:26: internal compiler error: unexpected expression ‘I’ of kind
template_parm_index
    9 | template <int I> TPL<Foo (I)> Baz ();
      |                      ~~~~^~~
0xe42ac2 cxx_eval_constant_expression
        /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:8597
0xe446a1 cxx_eval_outermost_constant_expr
        /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:8852
0xe458d7 maybe_constant_value(tree_node*, tree_node*, mce_value)
        /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:9161
0xe8ec41 cp_fully_fold
        /home/mpolacek/src/gcc/gcc/cp/cp-gimplify.cc:2852
0xe8edb0 cp_fully_fold(tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/cp-gimplify.cc:2871
0xe9e344 cp_convert_and_check(tree_node*, tree_node*, int)
        /home/mpolacek/src/gcc/gcc/cp/cvt.cc:668
0xdc6bff convert_like_internal
        /home/mpolacek/src/gcc/gcc/cp/call.cc:9022
0xdc6ec8 convert_like
        /home/mpolacek/src/gcc/gcc/cp/call.cc:9081
0xdc6f83 convert_like_with_context
        /home/mpolacek/src/gcc/gcc/cp/call.cc:9105
0xdca2f0 operator()
        /home/mpolacek/src/gcc/gcc/cp/call.cc:10232
0xdcc20b build_over_call
        /home/mpolacek/src/gcc/gcc/cp/call.cc:10289
0xdb79d2 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        /home/mpolacek/src/gcc/gcc/cp/call.cc:5123
0x11a5c16 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**,
bool, bool, int)
        /home/mpolacek/src/gcc/gcc/cp/semantics.cc:3136
0x114a6ad tsubst_expr(tree_node*, tree_node*, int, tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:21104
0x10fcd17 instantiate_non_dependent_expr_internal(tree_node*, int)
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:6468
0x11008a5 convert_nontype_argument
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:7481
0x1105dfa convert_template_argument
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:8833
0x1107d9a coerce_template_parms(tree_node*, tree_node*, tree_node*, int, bool)
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:9324
0x110aad8 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int)
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:10155
0x11aa0f0 finish_template_type(tree_node*, tree_node*, int)
        /home/mpolacek/src/gcc/gcc/cp/semantics.cc:4015

Reply via email to