diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGenCXX/function-template-specialization.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/function-template-specialization.cpp b/clang/test/CodeGenCXX/function-template-specialization.cpp new file mode 100644 index 00000000000..685306f8bed --- /dev/null +++ b/clang/test/CodeGenCXX/function-template-specialization.cpp @@ -0,0 +1,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); +}
\ No newline at end of file |