public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102396] New: ICE when using concepts, in get, at cp/constraint.cc:2637
@ 2021-09-18  8:02 dangelog at gmail dot com
  2021-09-27 12:51 ` [Bug c++/102396] [11/12 Regression] ICE when using concepts, in get, at cp/constraint.cc:2637 since r11-6245-g79f57d5cb070bb02 marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dangelog at gmail dot com @ 2021-09-18  8:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102396
           Summary: ICE when using concepts, in get, at
                    cp/constraint.cc:2637
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dangelog at gmail dot com
  Target Milestone: ---

Hello,

This testcase (which gets accepted by Clang and MSVC) causes an ICE under
GCC-12-trunk, and an erroneous compilation error on GCC 11.2.


#include <memory>
#include <span>
#include <ranges>
#include <concepts>

template <typename T> struct S;

template <typename C> constexpr bool is_S = false;
template <typename T> constexpr bool is_S<S<T>> = true;

template <typename T>
struct S {
    T data;

    S();
    explicit S(const T &);

    template <typename U,
              std::enable_if_t<!is_S<U>, bool> = false>
    requires std::equality_comparable_with<T, U>
    friend bool operator==(const S &s, const U &u) { return s.data == u; }
};

template <typename T>
bool operator==(const S<T> &a, const S<T> &b) { return a.data == b.data; }


int main() {
    using SD = S<double>;

    char data[sizeof(SD) * 10];
    std::span<SD> span((SD*)std::begin(data), (SD*)std::end(data));

    //static_assert(std::equality_comparable<std::span<SD>::iterator>);

    std::ranges::uninitialized_default_construct(span);
}



The error:



/opt/compiler-explorer/gcc-trunk-20210918/include/c++/12.0.0/concepts:280:17:
internal compiler error: in get, at cp/constraint.cc:2637
  280 |           { __t == __u } -> __boolean_testable;
      |             ~~~~^~~~~~
0x1fc77b9 internal_error(char const*, ...)
        ???:0
0x713d19 fancy_abort(char const*, int, char const*)
        ???:0
0x7970af satisfaction_cache::get()
        ???:0
0x79cd8a constraints_satisfied_p(tree_node*, tree_node*)
        ???:0
0x9ba323 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
        ???:0
0x73f150 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
        ???:0
0xa2fc50 build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node**, int)
        ???:0
0x79cd42 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x79cd8a constraints_satisfied_p(tree_node*, tree_node*)
        ???:0
0x9ba323 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
        ???:0
0x73f150 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
        ???:0
0xa2fc50 build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node**, int)
        ???:0
0x9816d7 instantiate_decl(tree_node*, bool, bool)
        ???:0
0x9c3e1b instantiate_pending_templates(int)
        ???:0
0x82a899 c_parse_final_cleanups()
        ???:0

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-13 16:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-18  8:02 [Bug c++/102396] New: ICE when using concepts, in get, at cp/constraint.cc:2637 dangelog at gmail dot com
2021-09-27 12:51 ` [Bug c++/102396] [11/12 Regression] ICE when using concepts, in get, at cp/constraint.cc:2637 since r11-6245-g79f57d5cb070bb02 marxin at gcc dot gnu.org
2021-11-05 13:23 ` rguenth at gcc dot gnu.org
2021-11-05 14:01 ` ppalka at gcc dot gnu.org
2021-12-09 18:52 ` dangelog at gmail dot com
2021-12-09 18:54 ` dangelog at gmail dot com
2021-12-11 16:13 ` ppalka at gcc dot gnu.org
2021-12-13 16:58 ` dangelog at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).