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 @@ -3895,6 +3895,8 @@ bool Compiler<Emitter>::VisitCXXUuidofExpr(const CXXUuidofExpr *E) {
3895
3895
template <class Emitter >
3896
3896
bool Compiler<Emitter>::VisitRequiresExpr(const RequiresExpr *E) {
3897
3897
assert (classifyPrim (E->getType ()) == PT_Bool);
3898
+ if (E->isValueDependent ())
3899
+ return false ;
3898
3900
if (DiscardResult)
3899
3901
return true ;
3900
3902
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