rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

Looks good, thanks! (Though we generally prefer fewer test files with more test 
per file, because a lot of the overhead of running tests is the setup / 
teardown time, so can you merge the two added tests into a single file?)



================
Comment at: clang/lib/Sema/SemaExpr.cpp:14952-14958
+      NamedDecl *Def;
+      EltTy->isIncompleteType(&Def);
+      if (Def && Def->isInvalidDecl()) {
+        Lambda->setInvalidDecl();
+        Field->setInvalidDecl();
+      }
+    }
----------------
jgorbe wrote:
> rsmith wrote:
> > I believe the `else` case here is redundant: if `RequireCompleteType` 
> > returns `false`, the type is complete and there's nothing more you need to 
> > do.
> If I just remove the `else` block, the test case included with the patch 
> keeps crashing. Is there any way a `Decl` can be invalid even after 
> `RequireCompleteType` returns `false`?
I think I was just wrong before :) Looks like `RequireCompleteType` doesn't 
check whether the type is invalid.


https://reviews.llvm.org/D54550



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

Reply via email to