[PATCH] D82188: [clang-tidy] Reworked enum options handling(again)

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 19 08:38:38 PDT 2020


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:30
   Options.store(Opts, "GslHeader", GslHeader);
   Options.store(Opts, "IncludeStyle", IncludeStyle);
 }
----------------
As a side bonus, this originally incorrect code would cast IncludeStyle to an int, then store that value. Now it will store it as the correct enum. Any other enums passed to store will error out if there is no mapping specialization for them, forcing you to either declare the mapping or cast it to an integer type


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82188





More information about the cfe-commits mailing list