[LLVMbugs] [Bug 6855] New: friend does not have access to private enum in declaration
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Apr 16 12:01:03 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=6855
Summary: friend does not have access to private enum in
declaration
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: evan at chromium.org
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
Created an attachment (id=4688)
--> (http://llvm.org/bugs/attachment.cgi?id=4688)
code (also pasted in bug)
[class.access] p5 in C++98 has an example and says this should be well-formed.
class C {
enum X {
X_VALUE
};
friend void foo(X);
};
// BUG: C::X is not available here
void foo(C::X x) {
// C::X is correctly available here
C::X x2 = C::X_VALUE;
}
$ clang++ test.cc
test.cc:12:13: error: 'X' is a private member of 'C'
void foo(C::X x) {
^
test.cc:4:8: note: declared private here
enum X {
^
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.
More information about the llvm-bugs
mailing list