[Bug c++/93527] Internal compiler error when static_assert concept std::regular on class with variadic constrained constructor.

pacoarjonilla at yahoo dot es gcc-bugzilla@gcc.gnu.org
Wed Feb 5 14:42:00 GMT 2020


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

--- Comment #5 from Paco Arjonilla <pacoarjonilla at yahoo dot es> ---
I could isolate the offensive code:
=====================================================
#include <concepts>

struct A { };
struct B : A {
  friend bool operator == (B, B) = default;
  friend bool operator != (B, B) = default;
};
static_assert(std::regular<B>);
=====================================================

On GCC10 master branch 2020.02.05 commit
9847df2c9573f1e4b948b5a7272c6aadf8e01c22


git  namiplot  src  g++10git -std=c++2a namidevel.cc 

namidevel.cc:11:20: error: static assertion failed
   11 | static_assert(std::regular<B>);
      |               ~~~~~^~~~~~~~~~
namidevel.cc:11:20: note: constraints not satisfied
In file included from namidevel.cc:1:
/usr/local/include/c++/10.0.1/concepts:288:15:   required for the satisfaction
of ‘__weakly_eq_cmp_with<B, B>’
/usr/local/include/c++/10.0.1/concepts:298:13:   required for the satisfaction
of ‘equality_comparable<B>’
/usr/local/include/c++/10.0.1/concepts:289:4:   in requirements with
‘std::remove_reference_t<B>& __t’, ‘std::remove_reference_t<B>& __u’
/usr/local/include/c++/10.0.1/concepts:290:10: note: the required expression
‘(__t == __u)’ is invalid
  290 |    { __t == __u } -> boolean;
      |      ~~~~^~~~~~
/usr/local/include/c++/10.0.1/concepts:291:10: internal compiler error: in
move_fn_p, at cp/decl.c:14094
  291 |    { __t != __u } -> boolean;
      |      ~~~~^~~~~~
0x627353 move_fn_p(tree_node const*)
        ../../gcc/gcc/cp/decl.c:14094
0x8875c2 joust
        ../../gcc/gcc/cp/call.c:11150
0x88795c tourney
        ../../gcc/gcc/cp/call.c:11656
0x895386 build_new_op_1
        ../../gcc/gcc/cp/call.c:6250
0x895c80 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
        ../../gcc/gcc/cp/call.c:6546
0xa74a46 build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node**, int)
        ../../gcc/gcc/cp/typeck.c:4245
0xa0bf68 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:19293
0x9fdfe9 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:18622
0x8cc6d6 diagnose_valid_expression
        ../../gcc/gcc/cp/constraint.cc:3144
0x8d26e3 satisfy_constraint_r
        ../../gcc/gcc/cp/constraint.cc:3183
0x8d2b28 satisfy_constraint
        ../../gcc/gcc/cp/constraint.cc:2599
0xa4c0a5 finish_static_assert(tree_node*, tree_node*, unsigned int, bool)
        ../../gcc/gcc/cp/semantics.c:9692
0x9a1ab3 cp_parser_static_assert
        ../../gcc/gcc/cp/parser.c:14678
0x9d76a2 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:13377
0x9d7e22 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4731
0x9d7e22 c_parse_file()
        ../../gcc/gcc/cp/parser.c:43714
0xaebc3b c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1186
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.


More information about the Gcc-bugs mailing list