From 4ebdf5c4f587daef4e0be499802eac3a7a49bf2f Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sat, 27 Jun 2009 10:45:02 +0000 Subject: Import Clang r74383. --- test/SemaTemplate/implicit-instantiation-1.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/SemaTemplate/implicit-instantiation-1.cpp') diff --git a/test/SemaTemplate/implicit-instantiation-1.cpp b/test/SemaTemplate/implicit-instantiation-1.cpp index eecaf2f6c799..b8f9622001e1 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 struct X { T f(T x, U y) { return x + y; } @@ -14,3 +13,13 @@ void test(X *xii, X *xpi, X *xip) { (void)xip->g(2, 0); // okay: does not instantiate } +template +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 -- cgit v1.3