[PATCH] D138381: [Support] Use a custom base class for FormatVariadicTest.cpp (NFC)

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 12:22:34 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa365f293dcab: [Support] Use a custom base class for FormatVariadicTest.cpp (NFC) (authored by kazu).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138381

Files:
  llvm/unittests/Support/FormatVariadicTest.cpp


Index: llvm/unittests/Support/FormatVariadicTest.cpp
===================================================================
--- llvm/unittests/Support/FormatVariadicTest.cpp
+++ llvm/unittests/Support/FormatVariadicTest.cpp
@@ -706,20 +706,21 @@
 
 namespace {
 
+enum class Base { First };
+
 class IntegerValuesRange final
-    : public indexed_accessor_range<IntegerValuesRange, NoneType, int, int *,
-                                    int> {
+    : public indexed_accessor_range<IntegerValuesRange, Base, int, int *, int> {
 public:
-  using indexed_accessor_range<IntegerValuesRange, NoneType, int, int *,
+  using indexed_accessor_range<IntegerValuesRange, Base, int, int *,
                                int>::indexed_accessor_range;
 
-  static int dereference(const NoneType &, ptrdiff_t Index) {
+  static int dereference(const Base &, ptrdiff_t Index) {
     return static_cast<int>(Index);
   }
 };
 
 TEST(FormatVariadicTest, FormatRangeNonRef) {
-  IntegerValuesRange Range(None, 0, 3);
+  IntegerValuesRange Range(Base(), 0, 3);
   EXPECT_EQ("0, 1, 2",
             formatv("{0}", make_range(Range.begin(), Range.end())).str());
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138381.476972.patch
Type: text/x-patch
Size: 1148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221121/4e00a3b2/attachment.bin>


More information about the llvm-commits mailing list