[llvm-bugs] [Bug 28517] New: Unable to call a protected member function from a derived class

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 12 02:49:45 PDT 2016


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

            Bug ID: 28517
           Summary: Unable to call a protected member function from a
                    derived class
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: roman.perepelitsa at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

struct B1 {
   protected:
    static void F(int);
  };

  struct B2 : B1 {
   protected:
    using B1::F;
    static void F();
  };

  struct D : B2 {
    template <class T>
    using Void = decltype(D::F(T()));
  };

  void Test() {
    using Void = D::Void<int>;
  }

Expected behaviour: compiles.
Actual behaviour: compile error (see below).

  15 : error: 'F' is a protected member of 'B2'
  using Void = decltype(D::F(T()));
  ~~~^
  19 : note: in instantiation of template type alias 'Void' requested here
  using Void = D::Void<int>;
  ^
  9 : note: declared protected here
  using B1::F;
  ^

-- 
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/20160712/4c281724/attachment.html>


More information about the llvm-bugs mailing list