[PATCH] D58659: [Sema] Fix assertion when `auto` parameter in lambda has an attribute.

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 26 15:43:39 PST 2019


jkorous added inline comments.


================
Comment at: clang/lib/Sema/SemaType.cpp:266
+        auto *NewAttrTy = cast<AttributedType>(T.getTypePtr());
+        for (TypeAttrPair &A : AttrsForTypes) {
+          if (A.first == AttrTy)
----------------
Do you think it would make sense to terminate the loop early if `AttrsForTypesSorted == true`?


================
Comment at: clang/lib/Sema/SemaType.cpp:270
+        }
+        AttrsForTypesSorted = false;
+      }
----------------
Do you think it would be reasonable to conditionally assign (or rather keep) `AttrsForTypesSorted = true` in case they were sorted previously and new key doesn't break the order?


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

https://reviews.llvm.org/D58659





More information about the cfe-commits mailing list