hokein marked an inline comment as done.
hokein added inline comments.

================
Comment at: clang/lib/Sema/SemaStmt.cpp:709
   } SwitchDiagnoser(Cond);
+  // The TypoExpr might be corrected to a non-intergral-or-enum type in the
+  // later stage without the proper type check, which is invalid for switch
----------------
sammccall wrote:
> How do we know Cond is a TypoExpr directly rather than containing one?
> 
> I think the usual strategy when code can't deal with typo correction being 
> delayed further is to call CorrectDelayedTyposInExpr.
no sure whether we should consider the containing-typo Cond, we might still 
want to keep the typo correction? thinking a case like 
`switch(return_int(typo-expr)) {}`.

Do you suggest that we use the `CorrectDelayedTyposInExpr` to check the whether 
Cond is/has a TypoExpr? `CorrectDelayedTyposInExpr` has a side effect of 
emitting the typo-suggestion diagnostic.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76592



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

Reply via email to