================
@@ -786,6 +797,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
   /// Keeps track of the deallocated DeclListNodes for future reuse.
   DeclListNode *ListNodeFreeList = nullptr;
 
+  std::unique_ptr<SemaProxy> SemaProxyPtr;
----------------
cor3ntin wrote:

> if I call Expr::HasSideEffects() today, I don't expect that to mutate my AST 
> out from under me. 

Sure, it won't

> If I call Expr::tryEvaluateString() I might expect that to fail instead of 
> mutating the AST out from under me.
Similarly, `tryEvaluateString` is not evaluating in a constant context.  So it 
won't mutate the ast.
Now, we could set a sema proxy in all the places where 
`EvalInfo::InConstantContext` is set to true, but what would that gain us?


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

Reply via email to