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

           Summary: Friend class cannot access protected field of parent
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


The following code compiles in g++, but not in clang++

class A {
protected:
    static int a;
};

class B : public A {
    friend class C;
};

class C {
    void foo() { 
        A::a = 0;
    }
};


$ clang++ -c a.cpp
a.cpp:12:6: error: 'a' is a protected member of 'A'
                A::a = 0;
                   ^
a.cpp:3:13: note: declared protected here
        static int a;
                   ^
1 error generated.

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