Douglas Gregor | c61361b | 2013-03-08 22:15:15 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Douglas Gregor | 5f8bd59 | 2009-05-26 22:09:24 +0000 | [diff] [blame] | 2 | |
| 3 | int* f(int); |
| 4 | float *f(...); |
| 5 | |
| 6 | template<typename T> |
| 7 | struct X { |
| 8 | typedef typeof(T*) typeof_type; |
| 9 | typedef typeof(f(T())) typeof_expr; |
| 10 | }; |
| 11 | |
| 12 | int *iptr0; |
| 13 | float *fptr0; |
| 14 | X<int>::typeof_type &iptr1 = iptr0; |
| 15 | |
| 16 | X<int>::typeof_expr &iptr2 = iptr0; |
| 17 | X<float*>::typeof_expr &fptr1 = fptr0; |
Douglas Gregor | c61361b | 2013-03-08 22:15:15 +0000 | [diff] [blame] | 18 | |
| 19 | namespace rdar13094134 { |
| 20 | template <class> |
| 21 | class X { |
| 22 | typedef struct { |
| 23 | Y *y; // expected-error{{unknown type name 'Y'}} |
| 24 | } Y; |
| 25 | }; |
| 26 | |
| 27 | X<int> xi; |
| 28 | } |