[PATCH] D57076: [ObjC generics] Fix applying `__kindof` to the type parameter.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 24 10:46:21 PST 2019


vsapsai marked 2 inline comments as done.
vsapsai added inline comments.


================
Comment at: clang/lib/AST/Type.cpp:1293
+
+    const auto *newAttrType = dyn_cast<AttributedType>(newType.getTypePtr());
+    if (newAttrType->getAttrKind() != attr::ObjCKindOf)
----------------
doug.gregor wrote:
> Either this should be a `cast<AttributedType>` or the next if should check for !newAttrType. I suspect the latter is safer.
You are right. Thanks for the catch. Currently it shouldn't happen, as far as I can tell, so no test for the case when AttributedType is transformed to something else.


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

https://reviews.llvm.org/D57076





More information about the cfe-commits mailing list