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

             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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Here is the small code

  1 struct class_2 {
  2 };
  3
  4 struct class_1 : private class_2 {
  5     struct class_2 var_2;
  6 };
  7
  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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to