[clang] Warning for incorrect useof 'pure' attribute (PR #78200)
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 15 18:23:01 PST 2024
================
@@ -692,6 +692,13 @@ def warn_maybe_falloff_nonvoid_function : Warning<
def warn_falloff_nonvoid_function : Warning<
"non-void function does not return a value">,
InGroup<ReturnType>;
+def warn_pure_attr_on_cxx_constructor : Warning<
+ "constructor cannot be 'pure' (undefined behavior)">,
+ InGroup<IncorrectAttributeUsage>;
----------------
ChuanqiXu9 wrote:
```suggestion
InGroup<<DiagGroup<"incorrect-pure-usage">>;
```
It looks a little bit far to invent `IncorrectAttributeUsage` group here
https://github.com/llvm/llvm-project/pull/78200
More information about the cfe-commits
mailing list