diff options
Diffstat (limited to 'test/SemaTemplate/implicit-instantiation-1.cpp')
-rw-r--r-- | test/SemaTemplate/implicit-instantiation-1.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/SemaTemplate/implicit-instantiation-1.cpp b/test/SemaTemplate/implicit-instantiation-1.cpp index eecaf2f..b8f9622 100644 --- a/test/SemaTemplate/implicit-instantiation-1.cpp +++ b/test/SemaTemplate/implicit-instantiation-1.cpp @@ -1,5 +1,4 @@ // RUN: clang-cc -fsyntax-only -verify %s - template<typename T, typename U> struct X { T f(T x, U y) { return x + y; } @@ -14,3 +13,13 @@ void test(X<int, int> *xii, X<int*, int> *xpi, X<int, int*> *xip) { (void)xip->g(2, 0); // okay: does not instantiate } +template<typename T, typename U> +T add(T t, U u) { + return t + u; // expected-error{{invalid operands}} +} + +void test_add(char *cp, int i, int *ip) { + char* cp2 = add(cp, i); + add(cp, cp); // expected-note{{instantiation of}} + (void)sizeof(add(ip, ip)); +}
\ No newline at end of file |