1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 template<typename T, typename U>
4 T f(T x, U y) { return x + y; }
6 unsigned g(T x, U y) { return sizeof(f(x, y)); }
9 void test(X<int, int> *xii, X<int*, int> *xpi, X<int, int*> *xip) {
12 (void)sizeof(xip->f(2, 0)); // okay: does not instantiate
13 (void)xip->g(2, 0); // okay: does not instantiate
16 template<typename T, typename U>
18 return t + u; // expected-error{{invalid operands}}
21 void test_add(char *cp, int i, int *ip) {
22 char* cp2 = add(cp, i);
23 add(cp, cp); // expected-note{{instantiation of}}
24 (void)sizeof(add(ip, ip));