[PATCH] D102779: [clang-tidy] cppcoreguidelines-explicit-constructor-and-conversion: new alias

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 29 00:08:17 PDT 2021


njames93 added a comment.

Is it worth using regex to ignore some operators:
`*::operator bool` to ignore all bool conversions etc.



================
Comment at: clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-explicit-constructor-and-conversion.rst:12-14
+This check implements `C.46 <https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c46-by-default-declare-single-argument-constructors-explicit>`_
+and `C.164 <https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c164-avoid-implicit-conversion-operators>`_
+from the CppCoreGuidelines.
----------------
The page generated from here will automatically redirect to the alias after 5 seconds so any extra documentation in here won't be read.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/google-explicit-constructor.rst:75
+    operator `operator B()` in class ``A`` would look as follows:
+    ``"A::operator B"``. The default list is empty.
----------------
double quotes aren't needed in options.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/google-explicit-constructor-ignoredconversionoperators-option.cpp:1-4
+// RUN: %check_clang_tidy -check-suffix=DEFAULT %s \
+// RUN: google-explicit-constructor %t -- \
+// RUN: -config='{CheckOptions: [ \
+// RUN: ]}'
----------------
Passing an explicitly empty config is unnecessary.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102779/new/

https://reviews.llvm.org/D102779



More information about the cfe-commits mailing list