https://bugs.llvm.org/show_bug.cgi?id=38131

            Bug ID: 38131
           Summary: Partial specialization is not matched inside of
                    template class
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: vladimir.guba...@itiviti.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

Code will compile if you remove template for A.

template <class T> 
class A
{
public:
  template <class F>
  A(const F & f) : m_holder(holder(f)) {}

  template <class F, class S>
  A(const F & f, const S & s) : m_holder(holder(f, s)) {}

private:
  struct IHolder {};

  template <class Msg, class Msg1 = int>
  struct Holder;

  template <class F>
  struct Holder<F> : IHolder
  {
    explicit Holder(const F & f) : m_f(f) { }
    F m_f;
  };

  template <class F, class S>
  struct Holder : IHolder
  {
    explicit Holder(const F & f, const S & s) : m_f(f), m_s(s) { }
    F m_f;
    S m_s;
};

  template <class F>
  static IHolder * holder(const F & f)
  {
    return new Holder<F, int>(f);
  }

  template <class F, class S>
  static IHolder * holder(const F & f, const S & s)
  {
    return new Holder<F, S>(f, s);
  }

  IHolder * m_holder;
};

int main()
{
    A<double>(10);
    A<double>(10, 10.);
    return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to