[PATCH] D59223: Objective-C++11: Support static_assert() in @interface/@implementation ivar lists and method declarations

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 08:00:37 PDT 2019

aaron.ballman added inline comments.

Comment at: clang/test/Parser/objc-static-assert.m:29
+struct S {
+  @defs(A);
thakis wrote:
> aaron.ballman wrote:
> > Given that static assertions are member declarations of a struct, should this "replay" the static asserts from the interface (including failing the assertions)?
> This only works in the old fragile abi and is unsupported in "modern" (8 year old) objc, and it was used very rarely even back then. I don't think we need to do anything about this other than not crashing.
Fine by me!

Comment at: clang/test/Parser/objc-static-assert.mm:4
+#if !__has_feature(objc_c_static_assert)
+#error failed
thakis wrote:
> aaron.ballman wrote:
> > Why do we expect `objc_c_static_assert` to be a supported feature in ObjC++? I would have expected this as an extension, but not a feature.
> Thanks for catching this, looks I forgot to re-run the .mm test after changing Features.def :-( Fixed now in r356154.
Great, thank you!

Other than those points, this LGTM as well. :-)

  rC Clang



More information about the cfe-commits mailing list