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

            Bug ID: 91467
           Summary: [concepts] ICE: in tsubst_copy, at cp/pt.c:15545
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: frederik.engels24 at gmail dot com
  Target Milestone: ---

Run with "g++ (Compiler-Explorer-Build) 10.0.0 20190814 (experimental)"
and options "-std=c++2a -fconcepts"

source code: https://godbolt.org/z/tOIbPZ
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
template<typename T>
struct foo {
    T t;

    template<typename U>
    void set(U&& u) requires requires { { static_cast<U&&>(u)} -> T; }
    {
        t = static_cast<U&&>(u);
    }
};

int main()
{
    auto w = foo<int>{5};
    w.set(5.0f);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
resulting in
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>: In function 'int main()':

<source>:15:15: internal compiler error: in tsubst_copy, at cp/pt.c:15545

   15 |     w.set(5.0f);

      |               ^

Please submit a full bug report,

with preprocessed source if appropriate.

See <https://gcc.gnu.org/bugs/> for instructions.

Compiler returned: 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to