| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
namespace N0 { |
| 4 |
template<typename T> |
| 5 |
void f0(); |
| 6 |
|
| 7 |
template<typename T> |
| 8 |
int x0 = 0; |
| 9 |
|
| 10 |
template<typename T> |
| 11 |
class C0; |
| 12 |
} |
| 13 |
using namespace N0; |
| 14 |
|
| 15 |
template<> |
| 16 |
void f0<int>(); // expected-error {{no function template matches}} |
| 17 |
|
| 18 |
template<> |
| 19 |
int x0<int>; |
| 20 |
|
| 21 |
template<> |
| 22 |
class C0<int>; |
| 23 |
|
| 24 |
namespace N1 { |
| 25 |
namespace N2 { |
| 26 |
template<typename T> |
| 27 |
void f2(); |
| 28 |
|
| 29 |
template<typename T> |
| 30 |
int x2 = 0; |
| 31 |
|
| 32 |
template<typename T> |
| 33 |
class C2; |
| 34 |
} |
| 35 |
using namespace N2; |
| 36 |
} |
| 37 |
|
| 38 |
template<> |
| 39 |
void N1::f2<int>(); // expected-error {{no function template matches}} |
| 40 |
|
| 41 |
template<> |
| 42 |
int N1::x2<int>; |
| 43 |
|
| 44 |
template<> |
| 45 |
class N1::C2<int>; |
| 46 |
|
| 47 |
namespace N3 { |
| 48 |
namespace N4 { |
| 49 |
template<typename T> |
| 50 |
void f4(); |
| 51 |
|
| 52 |
template<typename T> |
| 53 |
int x4 = 0; |
| 54 |
|
| 55 |
template<typename T> |
| 56 |
class C4; |
| 57 |
} |
| 58 |
using N4::f4; |
| 59 |
using N4::x4; |
| 60 |
using N4::C4; |
| 61 |
} |
| 62 |
|
| 63 |
template<> |
| 64 |
void N3::f4<int>(); // expected-error {{no function template matches}} |
| 65 |
|
| 66 |
template<> |
| 67 |
int N3::x4<int>; |
| 68 |
|
| 69 |
template<> |
| 70 |
class N3::C4<int>; |
| 71 |
|
| 72 |
inline namespace N5 { |
| 73 |
template<typename T> |
| 74 |
void f5(); |
| 75 |
|
| 76 |
template<typename T> |
| 77 |
int x5 = 0; |
| 78 |
|
| 79 |
template<typename T> |
| 80 |
class C5; |
| 81 |
} |
| 82 |
|
| 83 |
template<> |
| 84 |
void f5<int>(); |
| 85 |
|
| 86 |
template<> |
| 87 |
int x5<int>; |
| 88 |
|
| 89 |
template<> |
| 90 |
class C5<int>; |
| 91 |
|
| 92 |
namespace N6 { |
| 93 |
inline namespace N7 { |
| 94 |
template<typename T> |
| 95 |
void f7(); |
| 96 |
|
| 97 |
template<typename T> |
| 98 |
int x7 = 0; |
| 99 |
|
| 100 |
template<typename T> |
| 101 |
class C7; |
| 102 |
} |
| 103 |
} |
| 104 |
|
| 105 |
template<> |
| 106 |
void N6::f7<int>(); |
| 107 |
|
| 108 |
template<> |
| 109 |
int N6::x7<int>; |
| 110 |
|
| 111 |
template<> |
| 112 |
class N6::C7<int>; |