================
@@ -10936,6 +10939,46 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const 
CXXNewExpr *E) {
 
   return true;
 }
+
+//===----------------------------------------------------------------------===//
+// Reflection expression evaluation
+//===----------------------------------------------------------------------===//
+
+namespace {
+class ReflectionEvaluator
----------------
changkhothuychung wrote:

yeah there is already code to handle that, but those functions are in the base 
class ExprEvaluatorBase. Its a CTRP class template so we will need a derived 
class for it. Currently I have this code in the test file 

```cpp
template <auto R>
consteval auto f1() {
  return R;
}

static_assert(f1<^^int>() == ^^int);
```

So I believe the LHS will hit `EvaluateReflection` since the deduced return 
type is MetaInfo, and then the call to `ReflectionEvaluator(Info, 
Result).Visit(E)` will hit `VisitCallExpr` in the base class 
`ExprEvaluatorBase`.  Without having the class ReflectionEvaluator like 
currently, I believe we will have to repeat the work of ExprEvaluatorBase 
member functions in our function. Is there another way to handle this without 
inheriting the base class ExprEvaluatorBase? 



https://github.com/llvm/llvm-project/pull/190356
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to