aaron.ballman 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)
----------------
danielmarjamaki wrote:
> 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();
>                ^
> ```
> 
`diag(...) << cast<NamedDecl>(D)` is required; the diagnostic engine properly 
handles quoting `NamedDecl` objects.


https://reviews.llvm.org/D24656



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to