Douglas Gregor | c45c232 | 2009-03-31 00:43:58 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -fsyntax-only %s |
| 2 | |
| 3 | struct add_pointer { |
| 4 | template<typename T> |
| 5 | struct apply { |
| 6 | typedef T* type; |
| 7 | }; |
| 8 | }; |
| 9 | |
| 10 | struct add_reference { |
| 11 | template<typename T> |
| 12 | struct apply { |
| 13 | typedef T& type; |
| 14 | }; |
| 15 | }; |
| 16 | |
| 17 | template<typename MetaFun, typename T> |
| 18 | struct apply1 { |
| 19 | typedef typename MetaFun::template apply<T>::type type; |
| 20 | }; |
| 21 | |
| 22 | #if 0 |
| 23 | // FIXME: The code below requires template instantiation for dependent |
| 24 | // template-names that occur within nested-name-specifiers. |
| 25 | int i; |
| 26 | |
| 27 | apply1<add_pointer, int>::type ip = &i; |
| 28 | apply1<add_reference, int>::type ir = i; |
| 29 | #endif |