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

            Bug ID: 98800
           Summary: ICE on invalid use of non-static member function in
                    trailing return type since r251438
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

This invalid testcase is just a minor variant of PR97399#c4 where the member
function is_integral has been made non-static.

$ cat testcase.C
template <bool> struct enable_if_t {};
struct tmp {
  template <class>   constexpr bool is_integral();
  template <class E> static auto func() -> enable_if_t<is_integral<E>()>;
};
template <class> constexpr bool tmp::is_integral() { return true; }
int main() { tmp::func<int>(); }

$ g++ testcase.C
testcase.C: In substitution of ‘template<class T> static
enable_if_t<((tmp*)this)->is_integral<T>()> tmp::f() [with T = int]’:
testcase.C:21:15:   required from here
testcase.C:9:39: internal compiler error: in tsubst_copy, at cp/pt.c:16393
    9 |     -> enable_if_t<tmp::is_integral<T>()>; // { dg-message "in template
argument" }
      |                    ~~~~~~~~~~~~~~~~~~~^~

Reply via email to