[LLVMbugs] [Bug 12508] New: clang fails to consider inheritance-path access control for implicit calls to special members of virtual bases

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 9 15:06:44 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=12508

             Bug #: 12508
           Summary: clang fails to consider inheritance-path access
                    control for implicit calls to special members of
                    virtual bases
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rjmccall at apple.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


clang needs to be considering whether the inheritance path to a virtual base
constrains access when checking implicit calls to special members in the
following cases:
  - when deciding whether or not to define an implicit member as deleted (in
C++11)
  - when initializing a base-class subobject in a ctor
  - when checking access to subobject destructors in a ctor/dtor

As examples, I believe each of the following cases is ill-formed:
  struct A {
    A(); A(const A&); ~A();
  };
  class B : private virtual A {};

  class C : public B {
    C() : A() {} // explicit base init, implicit base destroy
    C(int) {} // implicit base init, implicit base destroy
    ~C() {} // implicit base destroy
  };

  class D {
    // In C++11, the implicit dtor, default ctor, and copy ctor here should all
be defined as deleted
  };

It looks like we currently get the explicit base-init case right, but not the
others.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list