Fznamznon added inline comments.

================
Comment at: clang/lib/Sema/SemaExpr.cpp:17897
+        if (SemaRef.FailedImmediateInvocations.contains(E))
+          CurrentII->setInt(1);
+      } else {
----------------
shafik wrote:
> It is not obvious to me why this is correct, can you please explain.
The visitor which this function is a part of traverses all subexpressions of a 
given ImmediateInvocationCandidate, it is saved to `CurrentII` member. Each 
ImmediateIvocationCandidate is a pair of integer and a pointer to ConstantExpr. 
The non-zero integer indicates that we should not try to evaluate particular 
immediate invocation. So, this patch, once found out that current expression 
contains a subexpression from another evaluation context whose evaluation 
failed before, marks that we shouldn't evaluate it to avoid double diagnosing. 
Otherwise, if some subexpression was found in the same context that current 
ImmediateInvocationCandidate belongs to, mark that we should not evaluate it 
instead, again to avoid double diagnosing. Hope that helps.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146234

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to