blob: 33cbf7f872e390ebcdd9c0c382a641dfa58a17bc [file] [log] [blame]
Douglas Gregoraba43bb2009-05-26 20:50:29 +00001// RUN: clang-cc -emit-llvm -femit-all-decls -o %t %s &&
2// RUN: grep "_ZNK4plusIillEclERKiRKl" %t | count 1
3
Douglas Gregord0e3daf2009-09-04 22:48:11 +00004// FIXME: We should not need the -femit-all-decls, because operator() should
5// be emitted as an external symbol rather than with linkonce_odr linkage.
6// This is a Sema problem.
Douglas Gregoraba43bb2009-05-26 20:50:29 +00007template<typename T, typename U, typename Result>
8struct plus {
Douglas Gregord0e3daf2009-09-04 22:48:11 +00009 Result operator()(const T& t, const U& u) const;
Douglas Gregoraba43bb2009-05-26 20:50:29 +000010};
11
Douglas Gregord0e3daf2009-09-04 22:48:11 +000012template<typename T, typename U, typename Result>
13Result plus<T, U, Result>::operator()(const T& t, const U& u) const {
14 return t + u;
15}
16
Douglas Gregoraba43bb2009-05-26 20:50:29 +000017template struct plus<int, long, long>;