@@ -157,20 +157,44 @@ struct A {
157157 }
158158};
159159
160+
161+
162+ // This shouldn't crash.
163+ static_assert (A<int >().f<int >() == 0 , " " );
164+ // The result should not be dependent.
165+ static_assert (A<int >().f<int >() != 0 , " " ); // expected-error {{static assertion failed due to requirement 'GH99873::A<int>().f<int>() != 0'}}
166+ // expected-note@-1 {{expression evaluates to '0 != 0'}}
167+ }
168+
169+
160170#if __cplusplus >= 201703L
161171namespace GH160497 {
162172
163173template <class > struct S {
164174 template <class >
165- static inline auto mem =
175+ inline static auto mem =
166176 [] { static_assert (false ); // expected-error {{static assertion failed}} \
167177 // expected-note {{while substituting into a lambda expression here}}
168178 return 42 ;
169179 }();
170180};
171181
172182using T = decltype (S<void >::mem<void >);
173- // expected-note@-1 {{in instantiation of static data member 'GH99873::GH160497::S<void>::mem<void>' requested here}}
183+ // expected-note@-1 {{in instantiation of static data member 'GH160497::S<void>::mem<void>' requested here}}
184+
185+
186+ template <class > struct S2 {
187+ template <class >
188+ inline static auto * mem =
189+ [] { static_assert (false ); // expected-error {{static assertion failed}} \
190+ // expected-note {{while substituting into a lambda expression here}}
191+ return static_cast <int *>(nullptr );
192+ }();
193+ };
194+
195+
196+ using T2 = decltype (S2<void >::mem<void >);
197+ // expected-note@-1 {{in instantiation of static data member 'GH160497::S2<void>::mem<void>' requested here}}
174198
175199namespace N1 {
176200
@@ -188,13 +212,6 @@ T y = 42;
188212}
189213#endif
190214
191- // This shouldn't crash.
192- static_assert (A<int >().f<int >() == 0 , " " );
193- // The result should not be dependent.
194- static_assert (A<int >().f<int >() != 0 , " " ); // expected-error {{static assertion failed due to requirement 'GH99873::A<int>().f<int>() != 0'}}
195- // expected-note@-1 {{expression evaluates to '0 != 0'}}
196- }
197-
198215template <typename >
199216class conditional {
200217};
0 commit comments