[PATCH] D83053: [clang-tidy] OptionsView::store specialized on bool

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 2 08:05:43 PDT 2020


njames93 created this revision.
njames93 added reviewers: aaron.ballman, alexfh, gribozavr2.
Herald added subscribers: cfe-commits, arphaman, kbarton, xazax.hun, nemanjai.
Herald added a project: clang.
njames93 marked an inline comment as done.
njames93 added inline comments.
Herald added a subscriber: wuzish.


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp:31
   Options.store(Opts, "GslHeader", GslHeader);
-  Options.store(Opts, "IncludeStyle", IncludeStyle);
+  Options.store(Opts, "IncludeStyle", IncludeStyle,
+                utils::IncludeSorter::getMapping());
----------------
Had to force this to explicitly call the correct function to avoid a compile error


Following on fcf7cc268fe <https://reviews.llvm.org/rGfcf7cc268fe4560bc7cd751494beceff45f5dd10> and 672207c319a <https://reviews.llvm.org/rG672207c319a06f20dc634bcd21678d5dbbe7a6b9> which granted checks the ability to read boolean configuration arguments as `true` or `false`.
This enables storing the options back to the configuration file using `true` and `false`.
This is in line with how clang-format dumps boolean options in its style config.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83053

Files:
  clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
  clang-tools-extra/clang-tidy/ClangTidyCheck.h
  clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
  clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83053.275121.patch
Type: text/x-patch
Size: 5131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200702/c31d174d/attachment-0001.bin>


More information about the cfe-commits mailing list