[PATCH] D58152: [Sema] Delay checking whether objc_designated_initializer is being applied to an init method

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 12 15:23:26 PST 2019


erik.pilkington created this revision.
erik.pilkington added reviewers: aaron.ballman, arphaman, erichkeane.
Herald added subscribers: jdoerfert, dexonsmith, jkorous.
Herald added a project: clang.

We ran into some source breaking changes to do with the attribute reordering changes that recently landed. The problem is that the order that `objc_designated_initializer` and `objc_method_family` are processed matters, because `objc_method_family` can make a method an init method, which is a prerequisite for `objc_designated_initializer`. When the attribute order flipped, the arrangement of these attributes that lead to an error and the arrangement that worked fine also flipped. This patch fixes this by delaying the check until both attributes have been processed.

rdar://47829358

Thanks!
Erik


Repository:
  rC Clang

https://reviews.llvm.org/D58152

Files:
  clang/include/clang/Basic/Attr.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/Misc/pragma-attribute-supported-attributes-list.test
  clang/test/SemaObjC/attr-designated-init.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58152.186551.patch
Type: text/x-patch
Size: 5871 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190212/4b739c3c/attachment.bin>


More information about the cfe-commits mailing list