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

            Bug ID: 120797
           Summary: ICE: in iterative_hash_template_arg, at cp/pt.cc:1775
                    under '-std=c++2a'
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rush102333 at gmail dot com
  Target Milestone: ---

Probably starts from gcc-13: https://godbolt.org/z/9bKE6fMz6

Simplified test:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

template<bool v>
constexpr bool false_v = false;

template<typename... Ts> requires
false_v<(requires (Ts ts) {requires sizeof(ts) != 0;} && ...)>

struct r3 {};

using r3i1 = r3<short, unsigned short>;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$g++ -std=c++2a -fsyntax-only test.cpp

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<source>: In substitution of 'template<class ... Ts>  requires 
false_v<(requires(Ts ts) {requires sizeof ts != 0;} && ...)> struct r3 [with Ts
= {short int, short unsigned int}]':
<source>:9:38:   required from here
    9 | using r3i1 = r3<short, unsigned short>;
      |                                      ^
<source>:5:37: internal compiler error: in iterative_hash_template_arg, at
cp/pt.cc:1775
    5 | false_v<(requires (Ts ts) {requires sizeof(ts) != 0;} && ...)>
      |                            ~~~~~~~~~^~~~~~~~~~~~~~~
0x2828ff5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x284a786 internal_error(char const*, ...)
        ???:0
0xae0b00 fancy_abort(char const*, int, char const*)
        ???:0
0xb6cb1d sat_hasher::hash(sat_entry*)
        ???:0
0xb6744f satisfaction_cache::satisfaction_cache(tree_node*, tree_node*,
sat_info)
        ???:0
0xb6a306 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd533e4 tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd47f91 tsubst_template_arg(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd58739 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xb6bdd8 constraints_satisfied_p(tree_node*, tree_node*)
        ???:0
0xd3bb0f lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int)
        ???:0
0xd8960c finish_template_type(tree_node*, tree_node*, int)
        ???:0
0xd08033 c_parse_file()
        ???:0
0xe6fb19 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 <https://gcc.gnu.org/bugs/> for instructions.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to