[LLVMbugs] [Bug 14298] New: Incorrect processing of private inheritance

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 8 22:20:09 PST 2012


             Bug #: 14298
           Summary: Incorrect processing of private inheritance
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: a.bataev at gmx.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Here is the small code

  1 struct class_2 {
  2 };
  4 struct class_1 : private class_2 {
  5     struct class_2 var_2;
  6 };
  8 struct class_0 : private class_1 {
  9     struct class_2 var_4;
 10 };

Clang unable to compile it with the following error message:
test.cpp:9:12: error: 'class_2' is a private member of 'class_2'
    struct class_2 var_4;
test.cpp:4:18: note: constrained by private inheritance here
struct class_1 : private class_2 {
test.cpp:1:8: note: member is declared here
struct class_2 {
1 error generated.

gcc compiles this code without any messages.

Alexey Bataev
Software Engineer
Intel Compiler Team
Intel Corp.

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