1 // RUN: %clang_cc1 -fms-extensions -fdelayed-template-parsing -fsyntax-only -verify -std=c++11 %s
13 void foo4() { } // expected-note {{previous definition is here}}
14 void foo4() { } // expected-error {{class member cannot be redeclared}}
15 void foo5() { } // expected-note {{previous definition is here}}
24 void B
<T
>::foo5() { // expected-error {{redefinition of 'foo5'}}
38 template void A
<int>::foo2();
46 template <class T
> void foo5() {} //expected-note {{previous definition is here}}
47 template <class T
> void foo5() {} // expected-error {{redefinition of 'foo5'}}
54 template <typename RunType
>
58 struct BindState
<void(void*)> {
64 typedef void RunType();
66 template <typename RunType
>
67 Callback(BindState
<RunType
> bind_state
) {
68 BindState
<RunType
>::Run();
74 return Callback(BindState
<void(void*)>());
79 namespace rdar11700604
{
80 template<typename T
> void foo() = delete;
85 template<typename T
> void foo() = delete;
91 template <typename
= void> struct ArrayRef
{
92 constexpr ArrayRef() {}
94 template <typename
= void> void CreateConstInBoundsGEP2_32() {
97 void LLVMBuildStructGEP() { CreateConstInBoundsGEP2_32(); }
102 template <typename T
>
103 constexpr T
Fun(T A
) { return T(0); }
105 constexpr int Var
= Fun(20);
108 template <typename T
>
109 auto invalidTrailingRetType() -> Bogus
{} // expected-error {{unknown type name 'Bogus'}}
113 struct HeapTypeConfig
{
114 static void from_bitset();
117 template <class Config
>
126 template<class Config
>
127 struct TypeImpl
<Config
>::BitsetType
{
129 Config::from_bitset();
134 TypeImpl
<HeapTypeConfig
>::Any();
137 template<typename A
> struct S
{
138 template<typename B
> struct T
;
140 template<typename A
> template<typename B
> struct S
<A
>::T
{
141 template<typename C
, typename D
> struct U
;
142 template<typename C
> struct U
<C
, C
> {
143 template<typename E
> static int f() {
144 return sizeof(A
) + sizeof(B
) + sizeof(C
) + sizeof(E
);
150 S
<int>::T
<int>::U
<int,int>::f
<int>();
153 template<typename T
> struct SS
{
154 template<typename U
> struct X
;
155 template<typename U
> struct X
<U
*>;
157 template<typename T
> template<typename U
> struct SS
<T
>::X
<U
*> {
159 return sizeof(T
) + sizeof(U
);
164 SS
<int>::X
<int*>::f();
175 use_delayed_identifier();
181 void use_delayed_identifier();
182 void trigger_PR38460() {
183 PR38460::T
<int>::foo();
186 template <typename
> struct PR38460_2
{
189 bool operator()(int) {}
197 template struct PR38460_2
<int>;