[libcxx-commits] [libcxx] [libc++] Fix a few tests that are missing proper suffixes (PR #73444)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 26 04:16:31 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 9ba74c2ee044381544c8e1e736c4c85a1a9d56bf 5950cd84c5669ee578e78fc2ce9e03ca4d8c9b32 -- libcxx/test/std/algorithms/alg.nonmodifying/alg.all_of/pstl.exception_handling.pass.cpp libcxx/test/std/experimental/memory/memory.observer.ptr/ctor.copy_move.pass.cpp libcxx/test/std/input.output/filesystems/class.file_status/file_status.status.eq.ops.pass.cpp libcxx/test/std/iterators/predef.iterators/counted.iterator/increment.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/std/iterators/predef.iterators/counted.iterator/increment.pass.cpp b/libcxx/test/std/iterators/predef.iterators/counted.iterator/increment.pass.cpp
index 66d90a4187..6ebbc58297 100644
--- a/libcxx/test/std/iterators/predef.iterators/counted.iterator/increment.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/counted.iterator/increment.pass.cpp
@@ -20,40 +20,42 @@
 
 #ifndef TEST_HAS_NO_EXCEPTIONS
 template <class It>
-class ThrowsOnInc
-{
-    It it_;
+class ThrowsOnInc {
+  It it_;
 
 public:
-    typedef          std::input_iterator_tag                   iterator_category;
-    typedef typename std::iterator_traits<It>::value_type      value_type;
-    typedef typename std::iterator_traits<It>::difference_type difference_type;
-    typedef It                                                 pointer;
-    typedef typename std::iterator_traits<It>::reference       reference;
+  typedef std::input_iterator_tag iterator_category;
+  typedef typename std::iterator_traits<It>::value_type value_type;
+  typedef typename std::iterator_traits<It>::difference_type difference_type;
+  typedef It pointer;
+  typedef typename std::iterator_traits<It>::reference reference;
 
-    constexpr It base() const {return it_;}
+  constexpr It base() const { return it_; }
 
-    ThrowsOnInc() = default;
-    explicit constexpr ThrowsOnInc(It it) : it_(it) {}
+  ThrowsOnInc() = default;
+  explicit constexpr ThrowsOnInc(It it) : it_(it) {}
 
-    constexpr reference operator*() const {return *it_;}
+  constexpr reference operator*() const { return *it_; }
 
-    constexpr ThrowsOnInc& operator++() {throw 42;}
-    constexpr ThrowsOnInc operator++(int) {throw 42;}
+  constexpr ThrowsOnInc& operator++() { throw 42; }
+  constexpr ThrowsOnInc operator++(int) { throw 42; }
 };
 #endif // TEST_HAS_NO_EXCEPTIONS
 
 struct InputOrOutputArchetype {
   using difference_type = int;
 
-  int *ptr;
+  int* ptr;
 
   constexpr int operator*() const { return *ptr; }
   constexpr void operator++(int) { ++ptr; }
-  constexpr InputOrOutputArchetype& operator++() { ++ptr; return *this; }
+  constexpr InputOrOutputArchetype& operator++() {
+    ++ptr;
+    return *this;
+  }
 };
 
-template<class Iter>
+template <class Iter>
 concept PlusEnabled = requires(Iter& iter) {
   iter++;
   ++iter;
@@ -84,7 +86,7 @@ constexpr bool test() {
   }
 
   {
-    static_assert( PlusEnabled<      std::counted_iterator<random_access_iterator<int*>>>);
+    static_assert(PlusEnabled< std::counted_iterator<random_access_iterator<int*>>>);
     static_assert(!PlusEnabled<const std::counted_iterator<random_access_iterator<int*>>>);
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/73444


More information about the libcxx-commits mailing list