[PATCH] D20917: [clang-tidy] modernize-use-auto: don't remove stars by default

Piotr Padlewski via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 3 13:31:45 PDT 2016


Prazek added inline comments.

================
Comment at: clang-tidy/modernize/UseAutoCheck.cpp:338
@@ -329,8 +337,3 @@
 
-    // Remove explicitly written '*' from declarations where there's more than
-    // one declaration in the declaration list.
-    if (Dec == *D->decl_begin())
-      continue;
-
     // All subsequent declarations should match the same non-decorated type.
     if (FirstDeclType != V->getType().getCanonicalType())
----------------
alexfh wrote:
> Prazek wrote:
> > Can you change this comment to make it more clear, or tell me what it do? I don't quite understand it right now
> Will this be better?
> 
>   // All subsequent variables in this declaration should have the same canonical type.
>   // For example, we don't want to use `auto` in `T *p = new T, **pp = new T*;`.
Much better, thanks!


http://reviews.llvm.org/D20917





More information about the cfe-commits mailing list