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

           Summary: Friend function definition not instantiated in certain
                    circumstances
           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 fails to link, not finding the definition of "f".

template<typename T> 
struct provide {
  friend T f() { return T(); }
};

void g() {
  void f();
  provide<void> p;
  f();
}

int main() {
  g();
}

Swapping the order of "void f();" and the definition of "p", or moving "void
f();" to namespace scope, makes it link correctly.

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