[LLVMbugs] [Bug 15841] New: linkage check for friend function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 24 15:50:53 PDT 2013


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

            Bug ID: 15841
           Summary: linkage check for friend function
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: weimingz at codeaurora.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

R171139 checks linkage compatibility. However, the friend function may need to
check lexical parent's linkage declaration.

For example:
extern "C" {
class Foo {
  int val;
  friend int bar(Foo &);
};
}

extern "C" int bar(Foo &f) {
  return f.val;
}

Clang complains

error: declaration of 'bar' has a different language linkage
extern "C" int bar(Foo &f) {
               ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130424/b4c4c713/attachment.html>


More information about the llvm-bugs mailing list