[PATCH] D84387: [AST][RecoveryExpr] Part4: Suppress spurious "err_typecheck_expect_scalar_operand" diagnostic

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 18 03:56:48 PDT 2020


sammccall added a comment.

I'm not sure I love having the assertion for contains-errors every place that handles dependent code in C.
We should certainly somehow document the reason dependence is possible, just as the possibility of overloads is documented.
But the assertion seems pretty heavyweight :-\



================
Comment at: clang/lib/Sema/SemaCast.cpp:2695
+      (DestType->isDependentType() || SrcExpr.get()->isTypeDependent() ||
+       SrcExpr.get()->isValueDependent())) {
+    assert((DestType->containsErrors() || SrcExpr.get()->containsErrors() ||
----------------
hokein wrote:
> This is similar to the way how C++ codepath handles dependent code, https://github.com/llvm/llvm-project/blob/master/clang/lib/Sema/SemaCast.cpp#L2527-L2532. 
also copy the comment?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84387



More information about the cfe-commits mailing list