-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
| Bugzilla Link | 19095 |
| Version | trunk |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor,@spavloff |
Extended Description
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)
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"