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

            Bug ID: 87480
           Summary: SFINAE constructor not matched, only in templated
                    function
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fiesh at zefix dot tv
  Target Milestone: ---

The following code compiles with gcc <= 7.3 and clang.  It also compiles with
gcc >= 8 when FIX is defined.  It does not compile with gcc >=8 without FIX
though.

struct e {
  template <typename f, typename = decltype(((f*)0)->d)> e(f);
};

struct A {
  double d;
};

#ifndef FIX
template <typename>
#endif
void j() {
  A k{};
  (void) static_cast<e>(k);
}

Reply via email to