1 #include "cxx-templates-common.h"
3 namespace hidden_specializations
{
4 // explicit specializations
5 template<> void fn
<int>() {}
6 template<> struct cls
<int> {
10 enum nested_enum
: int;
12 template<> int var
<int>;
14 // partial specializations
15 template<typename T
> struct cls
<T
*> {
18 static int nested_var
;
19 enum nested_enum
: int;
21 template<typename T
> int var
<T
*>;
23 // member specializations
24 template<> void cls
<void>::nested_fn() {}
25 template<> struct cls
<void>::nested_cls
{};
26 template<> int cls
<void>::nested_var
;
27 template<> enum class cls
<void>::nested_enum
{ e
};
28 template<> template<typename U
> void cls
<void>::nested_fn_t() {}
29 template<> template<typename U
> struct cls
<void>::nested_cls_t
{};
30 template<> template<typename U
> int cls
<void>::nested_var_t
;
32 // specializations instantiated here are ok if their pattern is
33 inline void use_stuff() {
39 cls
<void>::nested_fn_t
<char>();
40 cls
<void>::nested_cls_t
<char>();
41 (void)cls
<void>::nested_var_t
<char>;