[LLVMbugs] [Bug 8178] New: Clang doesn't accept public member reference that is private in derived class

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 18 05:28:26 PDT 2010


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

           Summary: Clang doesn't accept public member reference that is
                    private in derived class
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: schaub-johannes at web.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The following code is valid according to [class.access.base] paragraph 4 last
bullet. 

struct A {
  int a;
};

struct B : A {
private:
  using A::a;
};

int main() {
  B b;
  b.a = 0;
}


Clang gives

main1.cpp:12:5: error: 'a' is a private member of 'B'
  b.a = 0;
    ^
main1.cpp:7:12: note: declared private here
  using A::a;
           ^
1 error generated.

I'm not sure whether this is one of the weird access checking scenarious that
clang intentionally doesn't implement.

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