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'}}
51 namespace Inner_Outer_same_template_param_name {
70 template <typename RunType>
74 struct BindState<void(void*)> {
80 typedef void RunType();
82 template <typename RunType>
83 Callback(BindState<RunType> bind_state) {
84 BindState<RunType>::Run();
90 return Callback(BindState<void(void*)>());
95 namespace rdar11700604 {
96 template<typename T> void foo() = delete;
101 template<typename T> void foo() = delete;
107 template <typename = void> struct ArrayRef {
108 constexpr ArrayRef() {}
110 template <typename = void> void CreateConstInBoundsGEP2_32() {
113 void LLVMBuildStructGEP() { CreateConstInBoundsGEP2_32(); }
118 template <typename T>
119 constexpr T Fun(T A) { return T(0); }
121 constexpr int Var = Fun(20);
124 template <typename T>
125 auto invalidTrailingRetType() -> Bogus {} // expected-error {{unknown type name 'Bogus'}}
129 struct HeapTypeConfig {
130 static void from_bitset();
133 template <class Config>
142 template<class Config>
143 struct TypeImpl<Config>::BitsetType {
145 Config::from_bitset();
150 TypeImpl<HeapTypeConfig>::Any();
153 template<typename A> struct S {
154 template<typename B> struct T;
156 template<typename A> template<typename B> struct S<A>::T {
157 template<typename C, typename D> struct U;
158 template<typename C> struct U<C, C> {
159 template<typename E> static int f() {
160 return sizeof(A) + sizeof(B) + sizeof(C) + sizeof(E);
166 S<int>::T<int>::U<int,int>::f<int>();
169 template<typename T> struct SS {
170 template<typename U> struct X;
171 template<typename U> struct X<U*>;
173 template<typename T> template<typename U> struct SS<T>::X<U*> {
175 return sizeof(T) + sizeof(U);
180 SS<int>::X<int*>::f();