[PATCH] D120774: [clang-format] Handle builtins in constraint expression

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 1 23:46:19 PST 2022


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


================
Comment at: clang/unittests/Format/FormatTest.cpp:23747
+  verifyFormat("template <class T>\n"
+               "concept integral = __is_integral(T);");
+
----------------
How about other kinds?
This doesn't seem to work for at least ARRAY_TYPE_TRAIT (e.g. `concept OneDimensionalArray = __array_rank(T) == 1;`  and EXPRESSION_TRAIT.

Is there a way to be more generic and treat all identifier-like entities like identifiers?


================
Comment at: clang/unittests/Format/FormatTest.cpp:23747
+  verifyFormat("template <class T>\n"
+               "concept integral = __is_integral(T);");
+
----------------
curdeius wrote:
> How about other kinds?
> This doesn't seem to work for at least ARRAY_TYPE_TRAIT (e.g. `concept OneDimensionalArray = __array_rank(T) == 1;`  and EXPRESSION_TRAIT.
> 
> Is there a way to be more generic and treat all identifier-like entities like identifiers?
I'd like to see a test for ALIASes as well, e.g. `__is_same_as`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120774



More information about the cfe-commits mailing list