lukasza marked 5 inline comments as done.
lukasza added inline comments.

================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:10325
 
-  for (const auto *FD : RD.fields()) {
-    // Ill-formed if the field is an ObjectiveC pointer or of a type that is
-    // non-trivial for the purpose of calls.
-    QualType FT = FD->getType();
-    if (FT.getObjCLifetime() == Qualifiers::OCL_Weak) {
-      PrintDiagAndRemoveAttr(4);
-      return;
-    }
-
-    if (const auto *RT = FT->getBaseElementTypeUnsafe()->getAs<RecordType>())
-      if (!RT->isDependentType() &&
-          !cast<CXXRecordDecl>(RT->getDecl())->canPassInRegisters()) {
-        PrintDiagAndRemoveAttr(5);
+  std::queue<const RecordDecl *> RecordsWithFieldsToCheck;
+  RecordsWithFieldsToCheck.push(&RD);
----------------
gribozavr2 wrote:
> It looks like we don't need to visit the fields in a specific order. If 
> that's the case, please use SmallVector and pop_back_val. (See 
> AnalyzeImplicitConversions for an example of a typical worklist algorithm.)
There is no strong requirement to visit the fields in a specific order.  It 
seemed nice to report the first field in source order that causes trouble 
(rather than reporting an deterministically arbitrary field).  OTOH, using 
`SmallVector` will indeed result in simpler code.

Done?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155895

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D155895: ... Łukasz Anforowicz via Phabricator via cfe-commits

Reply via email to