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

================
Comment at: clang/lib/Sema/SemaStmt.cpp:2437
     if (RequireCompleteType(RangeLoc, RangeType,
-                            diag::err_for_range_incomplete_type))
+                            diag::err_for_range_incomplete_type)) {
+      if (LoopVar->getType()->isUndeducedType())
----------------
some details:
for the crash case, the RangeType is a `Bar<int>` class specialization, 
`RequireCompleteType` generates a definition decl of `Bar<int>`, which is 
invalid, and `RequireCompleteType` returns true, and doesn't emit a diagnostic 
(seems to suppress the "incomplete-type" diagnostic for invalid decls), so the 
trick `InvalidateOnErrorScope` (on Line 2396) doesn't invalidate the LoopVar 
Decl, we have to manually invalidate it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81384



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

Reply via email to