You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testcase:
template struct A {
A();
virtual int a(T x);
};
template A::A() {}
template int A::a(T x) { return *x; }
A x;
int main() { return 0; }
Output (clang x.cpp -fno-rtti):
/tmp/cc-nJeNb1.o:(.gnu.linkonce.r._ZTV1AIiE+0x8): undefined reference to `A::a()'
collect2: ld returned 1 exit status
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Compare to output from g++:
/tmp/x.cpp: In member function ‘int A::a(T) [with T = int]’:
/tmp/x.cpp:10: instantiated from here
/tmp/x.cpp:8: error: invalid type argument of ‘unary *’