Concept declaration requiring another concept fails

Bug #1831222 reported by Piotr Mikołajczyk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-8 (Ubuntu)
New
Undecided
Unassigned

Bug Description

template<typename T>
concept bool Addable = requires (T x, T y) {
    { x + y } -> T;
    { x += y } -> T&;
};

template<typename T>
concept bool SSemiring = requires(typename T::element_t& a, typename T::element_t& b, const Addable* vptr) {

    { a + b } -> typename T::element_t;
    { a * b } -> typename T::element_t;

    { T::zero() } -> typename T::element_t;
    { T::one() } -> typename T::element_t;

    { typename T::element_t{vptr} };

};

produces:
gcc_bug.hpp:10:93: internal compiler error: in synthesize_implicit_template_parm, at cp/parser.c:39065
 concept bool SSemiring = requires(typename T::element_t& a, typename T::element_t& b, const Addable* vptr) {
                                                                                             ^~~~~~~

Tags: concepts
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.