[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 27 10:38:50 PDT 2024
================
@@ -3141,6 +3148,10 @@ def warn_attribute_ignored_no_calls_in_stmt: Warning<
"statement">,
InGroup<IgnoredAttributes>;
+def warn_attribute_needs_aggregate : Warning<
----------------
erichkeane wrote:
just a quick grepping (and I gave up pretty quickly :D :
`err_anyx86_interrupt_attribute` < Though we're super inconsistent with this attribute
`err_using_if_exists_on_ctor` < This is almost exactly the current situation
`err_objc_direct_on_protocol`
`err_destroy_attr_on_non_static_var`
`err_musttail_needs_prototype`
`err_musttail_forbidden_from_this_context`
`err_musttail_needs_call`
`err_attribute_no_member_function` < Directly related, appertainment
`err_alignas_attribute_wrong_decl_type` < also appertainment
Counter points:
`warn_pure_function_returns_void`
`warn_objc_direct_property_ignored`
`warn_attribute_ignored_no_calls_in_stmt`
`warn_attribute_ignored_non_function_pointer`
`warn_function_attribute_ignored_in_stmt`
So it seems that we're pretty inconsistent, but 'appertainment on entity type' SEEMS to lean towards error? So my examples have managed to leave me 'whelmed' with evidence for each way. I still think waiting on Aaron is a good bit here, he was Attribute code owner for a long time, so he probably has more context for comment.
https://github.com/llvm/llvm-project/pull/102040
More information about the cfe-commits
mailing list