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

            Bug ID: 65707
           Summary: internal compiler error: in unify, at cp/pt.c:18577
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ldionne.2 at gmail dot com

The following code triggers an ICE on GCC trunk:

------------------------------------------------------------------------------
#include <type_traits>

template <bool>
struct when;

template <typename T>
struct always_true : std::true_type { };


template <typename T, typename = when<true>>
struct f;

template <typename T>
struct f<T, when<always_true<T>{}>> { };

template struct f<int>;
------------------------------------------------------------------------------

The exact command line is:

› ~/code/gcc5/bin/g++ ~/code/hana/test/worksheet.cpp -std=c++1y
[...]: internal compiler error: in unify, at cp/pt.c:18577
 template struct f<int>;
                 ^

Note that changing

    when<predicate<T>{}>

to

    when<predicate<T>{}()>

fixes the problem.

Reply via email to