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

            Bug ID: 82507
           Summary: [concepts] premature substitution into constraint of
                    non-template member function
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric.niebler at gmail dot com
  Target Milestone: ---

According to Andrew Sutton, the following code should compile:

template <class I>
concept bool True = true;

template <class T>
concept bool HasType = requires { typename T::type; };

template <class T>
struct S {
  void foo() requires HasType<T> && True<typename T::type>;
};

S<int> s;


The failure of the HasType<T> constraint should prevent substitution from
happening into True<>, avoiding a hard error. Instead, substitution happens
eagerly, leading to a hard error.

Reply via email to