[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 09:07:10 PDT 2017


alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.

A few more nits.



================
Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h:68
   bool IgnoreArrays;
+  // Whether fix-its for initializers of fundamental type use literals. Only
+  // effective in C++11 mode. Default is false.
----------------
nit: Please add an empty line before the comment.


================
Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h:68
   bool IgnoreArrays;
+  // Whether fix-its for initializers of fundamental type use literals. Only
+  // effective in C++11 mode. Default is false.
----------------
alexfh wrote:
> nit: Please add an empty line before the comment.
"use literals" and "UseAssignment" should be consistent, I guess.


================
Comment at: test/clang-tidy/cppcoreguidelines-pro-type-member-init-use-assignment.cpp:38
+  // CHECK-FIXES: T t{};
+  S() {};
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: constructor does not initialize these fields:
----------------
No need for a semicolon here.


https://reviews.llvm.org/D24892





More information about the cfe-commits mailing list