9 static int static_member
;
23 // Templates (instantiations).
24 template<typename T
> struct traits
{};
26 typename Traits
= traits
<T
>
30 // Explicit template instantiation.
31 extern template class Template
<int>;
33 extern template struct traits
<float>;
34 typedef class Template
<float> FloatInstantiation
;
37 Template
<long> invisible
;
40 // Non-template inside a template.
41 template <class> struct Outer
{
47 template <class T
> Outer
<T
>::Outer() {
51 // Partial template specialization.
52 template <typename
...> class A
;
53 template <typename T
> class A
<T
> {};
55 // Anchored by a function parameter.
59 // Virtual class with a forward declaration.
65 struct PureForwardDecl
;
67 typedef union { int i
; } TypedefUnion
;
68 typedef enum { e0
= 0 } TypedefEnum
;
69 typedef struct { int i
; } TypedefStruct
;
71 union { int i
; } GlobalUnion
;
72 struct { int i
; } GlobalStruct
;
73 enum { e5
= 5 } GlobalEnum
;
77 struct InAnonymousNamespace
{ int i
; };
83 virtual Base
*getParent() const;
86 class Derived
: Base
{
88 Derived
*getParent() const override
;
96 typedef Template1
<void *> TypedefTemplate
;
97 extern template class Template1
<int>;
99 template <class T
> class FwdDeclTemplate
;
100 typedef FwdDeclTemplate
<int> TypedefFwdDeclTemplate
;
102 // Member classes of class template specializations.
103 template <typename T
> struct Specialized
{};
105 template <> struct Specialized
<int> {
109 template <class T
> struct FwdDeclTemplateMember
{ struct Member
; };
110 typedef FwdDeclTemplateMember
<int>::Member TypedefFwdDeclTemplateMember
;
112 // Base class specialized on the class itself.
113 template <typename Derived
> class BaseTemplate
{};
114 template <typename T
>
115 class WithSpecializedBase
: public BaseTemplate
<WithSpecializedBase
<T
>> {};
116 typedef WithSpecializedBase
<float> SpecializedBase
;