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

            Bug ID: 28929
           Summary: make_shared accesses protected constructors
           Product: libc++
           Version: 3.9
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: aa...@aaronballman.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
    Classification: Unclassified

Consider the following code:

#include <memory>

struct S {
private:
  S();

 public:
   void f() { (void)std::make_shared<S>(); }
};

struct T {
protected:
  T();

 public:
   void f() { (void)std::make_shared<T>(); }
};

S::f() will fail to compile because S::S() is private, but T::f() does not fail
to compile with a protected constructor. Giving the class a data member, or
marking the class as final, will cause T::f() to fail as well. Likely caused by
use of EBO.

-- 
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