Mike Stump | 2a70e94 | 2009-11-16 18:06:39 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -emit-llvm -triple i686-pc-linux-gnu -o %t %s |
Douglas Gregor | 9f18507 | 2009-09-11 20:15:17 +0000 | [diff] [blame] | 2 | // RUN: grep "define i32 @_ZNK4plusIillEclERKiRKl" %t | count 1 |
Douglas Gregor | aba43bb | 2009-05-26 20:50:29 +0000 | [diff] [blame] | 3 | |
| 4 | template<typename T, typename U, typename Result> |
| 5 | struct plus { |
Douglas Gregor | d0e3daf | 2009-09-04 22:48:11 +0000 | [diff] [blame] | 6 | Result operator()(const T& t, const U& u) const; |
Douglas Gregor | aba43bb | 2009-05-26 20:50:29 +0000 | [diff] [blame] | 7 | }; |
| 8 | |
Douglas Gregor | d0e3daf | 2009-09-04 22:48:11 +0000 | [diff] [blame] | 9 | template<typename T, typename U, typename Result> |
| 10 | Result plus<T, U, Result>::operator()(const T& t, const U& u) const { |
| 11 | return t + u; |
| 12 | } |
| 13 | |
Douglas Gregor | aba43bb | 2009-05-26 20:50:29 +0000 | [diff] [blame] | 14 | template struct plus<int, long, long>; |