[PATCH] D138914: Make evaluation of nested requirement consistent with requires expr.

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 06:21:31 PST 2022


erichkeane added inline comments.


================
Comment at: clang/include/clang/AST/ExprConcepts.h:428
+      : Requirement(RK_Nested,
+                    Constraint && Constraint->isInstantiationDependent(),
+                    Constraint && Constraint->containsUnexpandedParameterPack(),
----------------
I'm a little concerned that we're changing to a situation where the constraint in a nested-requirement can be null like this.  The other cases it can be null we consider it a 'substitution failure' (see the 1st constructor).

It seems to me that we perhaps need a different state here for that.


================
Comment at: clang/test/SemaTemplate/instantiate-requires-expr.cpp:27
 false_v<requires (T t) { requires is_same_v<decltype(t), int>; }>
-// expected-note at -1 {{because 'false_v<requires (int t) { requires is_same_v<decltype(t), int>; }>' evaluated to false}}
-// expected-note at -2 {{because 'false_v<requires (char t) { requires is_same_v<decltype(t), int>; }>' evaluated to false}}
+// expected-note at -1 {{because 'false_v<requires (int t) { requires <null expr>; }>' evaluated to false}}
+// expected-note at -2 {{because 'false_v<requires (char t) { requires <null expr>; }>' evaluated to false}}
----------------
This is wrong here, we shouldn't be making our diagnostics incorrect like this.  


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138914/new/

https://reviews.llvm.org/D138914



More information about the cfe-commits mailing list