[llvm-bugs] [Bug 38131] New: Partial specialization is not matched inside of template class

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 11 03:10:01 PDT 2018


            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: unassignedclangbugs at nondot.org
          Reporter: Vladimir.Gubarev at itiviti.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Code will compile if you remove template for A.

template <class T> 
class A
  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)) {}

  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, 10.);
    return 0;

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180711/059defba/attachment.html>

More information about the llvm-bugs mailing list