Douglas Gregor | 0499ab6 | 2011-02-25 15:54:31 +0000 | [diff] [blame^] | 1 | // RUN: %clang-cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | // Note: the formatting in this test case is intentionally funny, with |
| 4 | // nested-name-specifiers stretched out vertically so that we can |
| 5 | // match up diagnostics per-line and still verify that we're getting |
| 6 | // good source-location information. |
| 7 | |
| 8 | namespace outer { |
| 9 | namespace inner { |
| 10 | template<typename T> |
| 11 | struct X0 { |
| 12 | }; |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | template<typename T> |
| 17 | struct add_reference { |
| 18 | typedef T& type; |
| 19 | }; |
| 20 | |
| 21 | namespace outer_alias = outer; |
| 22 | |
| 23 | template<typename T> |
| 24 | struct UnresolvedUsingValueDeclTester { |
| 25 | using outer::inner::X0< |
| 26 | typename add_reference<T>::type |
| 27 | * // expected-error{{declared as a pointer to a reference of type}} |
| 28 | >::value; |
| 29 | }; |
| 30 | |
| 31 | UnresolvedUsingValueDeclTester<int> UnresolvedUsingValueDeclCheck; // expected-note{{in instantiation of template class}} |
| 32 | |
| 33 | template<typename T> |
| 34 | struct UnresolvedUsingTypenameDeclTester { |
| 35 | using outer::inner::X0< |
| 36 | typename add_reference<T>::type |
| 37 | * // expected-error{{declared as a pointer to a reference of type}} |
| 38 | >::value; |
| 39 | }; |
| 40 | |
| 41 | UnresolvedUsingTypenameDeclTester<int> UnresolvedUsingTypenameDeclCheck; // expected-note{{in instantiation of template class}} |
| 42 | |