[PATCH] D28973: Supresses misc-move-constructor-init warning for const fields.

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 22 12:56:05 PST 2017


alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tools-extra/test/clang-tidy/misc-move-constructor-init.cpp:88
+struct O {
+  O(O&& other) : b(other.b) {} // ok
+  const B b;
----------------
The test is fine, but it would also pass, if the check verified constness of the field being initialized. I'd suggest adding another one that shows a const-qualified initializer used to initialize a non-const field.


================
Comment at: clang-tools-extra/test/clang-tidy/misc-move-constructor-init.cpp:90
+  const B b;
+}
+
----------------
Missing semicolon. I wonder how the test still passes. It passes, doesn't it?


https://reviews.llvm.org/D28973





More information about the cfe-commits mailing list