[LLVMbugs] [Bug 8852] New: Definition of friend function inside the class is not working if the function is declared in namespace scope

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 23 18:51:34 PST 2010


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

           Summary: Definition of friend function inside the class is not
                    working if the function is declared in namespace scope
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: akyrtzi at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


$ cat t.cpp

void foo();

struct S {
  friend void foo() {}
};

int main() {
    foo();
}

$ g++ t.cpp

$ clang t.cpp
Undefined symbols for architecture x86_64:
  "foo()", referenced from:
      _main in cc-hzoATp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

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