[PATCH] D24656: [clang-tidy] Add check readability-redundant-declaration

Daniel Marjamäki via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 12 01:22:33 PDT 2016


danielmarjamaki added inline comments.


================
Comment at: clang-tidy/readability/RedundantDeclarationCheck.cpp:60
+    auto Diag = diag(D->getLocation(), "redundant '%0' declaration")
+        << cast<NamedDecl>(D)->getName();
+    if (!MultiVar && !DifferentHeaders)
----------------
alexfh wrote:
> It should be possible to just use `D` here.
Thanks. It's not possible:

```
RedundantDeclarationCheck.cpp:61:15: error: ‘const class clang::Decl’ has no member named ‘getName’
         << D->getName();
               ^
```



https://reviews.llvm.org/D24656





More information about the cfe-commits mailing list