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) {
38953895template <class Emitter >
38963896bool Compiler<Emitter>::VisitRequiresExpr(const RequiresExpr *E) {
38973897 assert (classifyPrim (E->getType ()) == PT_Bool);
3898+ if (E->isValueDependent ())
3899+ return false ;
38983900 if (DiscardResult)
38993901 return true ;
39003902 return this ->emitConstBool (E->isSatisfied (), E);
Original file line number Diff line number Diff line change @@ -239,3 +239,17 @@ namespace GH150705 {
239239 constexpr const A& a = b;
240240 constexpr auto x = (a.*q)(); // both-error {{constant expression}}
241241}
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