rsmith added a comment.

Thanks!



================
Comment at: clang/lib/Sema/SemaExpr.cpp:14946
+  // as invalid as well.
+  if (const CXXRecordDecl *RD = FieldType->getAsCXXRecordDecl()) {
+    if (RD->isInvalidDecl()) {
----------------
You'll need to use `FieldType->getBaseElementTypeUnsafe()` or similar here to 
handle the case where the field type is an array whose element type is a class. 
(That can happen in a lambda if you capture a local array variable by value.)


================
Comment at: clang/lib/Sema/SemaExpr.cpp:14948
+    if (RD->isInvalidDecl()) {
+      Lambda->setInvalidDecl();
+    }
----------------
For consistency with the class case, I think we should mark the field invalid 
in this case too.


Repository:
  rC Clang

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