[PATCH] D140423: [WIP][clang] Add PrintingPolicy callback for identifying default template arguments

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 12:36:41 PST 2023


dblaikie added inline comments.


================
Comment at: clang/include/clang/AST/PrettyPrinter.h:52
+
+  enum class TriState : int { kYes, kNo, kUnknown };
+
----------------
We don't usually use the `k` prefix for enums (the style guide mentions using an acronym like `TS_` - though even that's unnecessary with an enum class, where you have to use `EnumClassName` prefix anyway, so there's no issue with ambiguity/name collisions of the enumerators)

But also, I'm guessing we probably use `std::optional<bool>` for this sort of thing more frequently than defining a three-state enum (even though `std::optional<bool>` can be a bit awkward to use/error prone, it's not too bad for limited uses like this).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140423



More information about the cfe-commits mailing list