[clang] Warning for incorrect useof 'pure' attribute (PR #78200)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 06:11:36 PST 2024


================
@@ -11792,6 +11792,32 @@ static bool CheckMultiVersionFunction(Sema &S, FunctionDecl *NewFD,
                                          OldDecl, Previous);
 }
 
+static void CheckFunctionDeclarationAttributesUsage(Sema &S,
+                                                    FunctionDecl *NewFD) {
+  const bool is_pure = NewFD->hasAttr<PureAttr>();
+  const bool is_const = NewFD->hasAttr<ConstAttr>();
----------------
AaronBallman wrote:

```suggestion
  bool IsPure = NewFD->hasAttr<PureAttr>();
  bool IsConst = NewFD->hasAttr<ConstAttr>();
```
adjusting for coding style nits.

https://github.com/llvm/llvm-project/pull/78200


More information about the cfe-commits mailing list