http://llvm.org/bugs/show_bug.cgi?id=7230
Summary: extern "C" global function can't be made a friend of a
class in a namespace
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]
Created an attachment (id=4931)
--> (http://llvm.org/bugs/attachment.cgi?id=4931)
Non-working example
(Or at least, not easily.)
I get these errors:
nt.cc:10:19: error: no function named 'F' with type 'void ()' was found in the
specified scope
friend void ::F(void);
^
nt.cc:15:11: error: 'foo' is a private member of 'N::C'
N::bar->foo();
^
nt.cc:9:10: note: declared private here
void foo(void);
^
2 errors generated.
If the function F() is in the namespace (or if everything's global) there's no
problem.
gcc accepts the code. This is a stripped example from the real code which is
accepted by VS, Sun Studio (or whatever it's called now) and HP-UX's compiler.
(The code may well still be incorrect, but if it is I'm not sure why.)
--
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