Douglas Gregor | d7b9e9f | 2009-06-22 23:57:29 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
2 | |||||
3 | template<typename T, typename U> | ||||
4 | struct X { | ||||
5 | T f(T x, U y) { return x + y; } | ||||
6 | |||||
7 | unsigned g(T x, U y) { return sizeof(f(x, y)); } | ||||
8 | }; | ||||
9 | |||||
10 | void test(X<int, int> *xii, X<int*, int> *xpi, X<int, int*> *xip) { | ||||
11 | (void)xii->f(1, 2); | ||||
12 | (void)xpi->f(0, 2); | ||||
13 | (void)sizeof(xip->f(2, 0)); // okay: does not instantiate | ||||
14 | (void)xip->g(2, 0); // okay: does not instantiate | ||||
15 | } | ||||
16 |