summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/function-template-specialization.cpp
blob: 685306f8bed419cc6a548c25835409254169f130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: clang-cc -emit-llvm %s -o -
template<typename T, typename U>
T* next(T* ptr, const U& diff);

template<typename T, typename U>
T* next(T* ptr, const U& diff) { 
  return ptr + diff; 
}

void test(int *iptr, float *fptr, int diff) {
  iptr = next(iptr, diff);
  fptr = next(fptr, diff);
}

template<typename T, typename U>
T* next(T* ptr, const U& diff);

void test2(int *iptr, double *dptr, int diff) {
  iptr = next(iptr, diff);
  dptr = next(dptr, diff);
}
OpenPOWER on IntegriCloud