[PATCH] PR19095 Undefined reference to friend template function defined inside template class

suyog sarda sardask01 at gmail.com
Fri Mar 14 09:59:29 PDT 2014


Hi,

Attaching patch for bug 19095. Please help in reviewing the same.

Also, I haven't attached a test case yet in the patch as i am not sure how
it should be and in which file it should be.

In my opinion, the test case would go into *tools/clang/test/SemaCXX/friend.cpp
*would be something like below (similar to that mentioned in the bug)




























*template <class T>void f(T);template <class U>class C{  template <class
T>  friend void f(T)  {     C<U> c;     c.i = 3;  }  public :     void
g()     {       f(3.0); // OK     }    int i;};void h (){  f(7); // OK
C<double> c;  c.g();}*


Please help in reviewing the patch as well as the test case.
-- 
With regards,
Suyog Sarda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140314/1aa9adc8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR_19095.patch
Type: text/x-patch
Size: 698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140314/1aa9adc8/attachment.bin>


More information about the cfe-commits mailing list