[PATCH] D25316: [clang-tidy] Enhance modernize-use-auto to casts

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 09:41:58 PDT 2016

aaron.ballman added a comment.

Does this check properly work in the presence of macros? Those are sometimes more common in casting operations, so a few explicit tests would be good (those tests could be follow-on work if it turns out that this check doesn't play nicely with macros).

Comment at: clang-tidy/modernize/UseAutoCheck.cpp:404
+                [](const Expr *Expr) { return Expr->getType(); },
+                "use auto when initializing with new to avoid "
+                "duplicating the type name");
Quote use of `auto` and `new` in the diagnostic since they're syntax rather than english.

Comment at: clang-tidy/modernize/UseAutoCheck.cpp:413
+        },
+        "use auto when initializing with a cast to avoid duplicating the type "
+        "name");
Same here.



More information about the cfe-commits mailing list