[PATCH] D100669: [ADT] Add llvm::remove_cvref and llvm::remove_cvref_t

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 18 11:05:17 PDT 2021


dblaikie accepted this revision.
dblaikie added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/unittests/ADT/STLForwardCompatTest.cpp:48-52
+using STLForwardCompatRemoveCVRefTestTypes = ::testing::Types<
+    std::pair<int, int>, std::pair<int &, int>, std::pair<const int, int>,
+    std::pair<volatile int, int>, std::pair<const volatile int &, int>,
+    std::pair<int *, int *>, std::pair<int *const, int *>,
+    std::pair<const int *, const int *>, std::pair<int *&, int *>>;
----------------
scott.linder wrote:
> The formatting here gets a bit muddy, I considered adding a typedef of `std::pair` with a longer name, so that the formatting would refer one entry per line. Does that seem like it would be an improvement?
I wouldn't change the type to force a different formatting - I think clang-format has some comment you can use to disable its formatting? Or you can add an empty comment to force a line break.
```
using STLForwardCompatRemoveCVRefTestTypes = ::testing::Types<
    // clang-format off
    std::pair<int, int>,
    std::pair<int &, int>,  
    std::pair<const int, int>,
    std::pair<volatile int, int>,
    std::pair<const volatile int &, int>,
    std::pair<int *, int *>,
    std::pair<int *const, int *>,
    std::pair<const int *, const int *>,
    std::pair<int *&, int *>
    // clang-format on
    >;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100669



More information about the llvm-commits mailing list