<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - dejagnu test fails to compile with clang g++.old-deja/g++.pt/friend10.C"
   href="http://llvm.org/bugs/show_bug.cgi?id=19095">19095</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>dejagnu test fails to compile with clang g++.old-deja/g++.pt/friend10.C
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sardask01@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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);
     }
    int i;
};

int main ()
{
  f(7);
  C<double> c;
  c.g();
}


This Test Case compiles with g++. Fails with clang, linker error - unable to
find definition of function f() with following error :

Opensource/llvm/build/bin/clang friend10.C 

/tmp/friend10-f7127e.o: In function `main':
friend10.C:(.text+0x16): undefined reference to `void f<int>(int)'
/tmp/friend10-f7127e.o: In function `C<double>::g()':
friend10.C:(.text._ZN1CIdE1gEv[_ZN1CIdE1gEv]+0x1b): undefined reference to
`void f<double>(double)'
clang-3.5: error: linker command failed with exit code 1 (use -v to see
invocation)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>