File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -3879,6 +3879,8 @@ bool Compiler<Emitter>::VisitCXXUuidofExpr(const CXXUuidofExpr *E) {
3879
3879
template <class Emitter >
3880
3880
bool Compiler<Emitter>::VisitRequiresExpr(const RequiresExpr *E) {
3881
3881
assert (classifyPrim (E->getType ()) == PT_Bool);
3882
+ if (E->isValueDependent ())
3883
+ return false ;
3882
3884
if (DiscardResult)
3883
3885
return true ;
3884
3886
return this ->emitConstBool (E->isSatisfied (), E);
Original file line number Diff line number Diff line change @@ -239,3 +239,17 @@ namespace GH150705 {
239
239
constexpr const A& a = b;
240
240
constexpr auto x = (a.*q)(); // both-error {{constant expression}}
241
241
}
242
+
243
+ namespace DependentRequiresExpr {
244
+ template <class T ,
245
+ bool = []() -> bool { // both-error {{not a constant expression}}
246
+ if (requires { T::type; })
247
+ return true ;
248
+ return false ;
249
+ }()>
250
+ struct p {
251
+ using type = void ;
252
+ };
253
+
254
+ template <class T > using P = p<T>::type; // both-note {{while checking a default template argument}}
255
+ }
You can’t perform that action at this time.
0 commit comments