[libcxx-commits] [libcxx] [libc++][iostream] Applied `[[nodiscard]]` (PR #173754)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 27 22:32:55 PST 2025


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 origin/main HEAD --extensions ,cpp,h -- libcxx/test/libcxx/input.output/iostream.format/nodiscard.verify.cpp libcxx/test/libcxx/input.output/stream.buffers/nodiscard.verify.cpp libcxx/include/__ostream/basic_ostream.h libcxx/include/istream libcxx/include/streambuf libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/libcxx/test/libcxx/input.output/iostream.format/nodiscard.verify.cpp b/libcxx/test/libcxx/input.output/iostream.format/nodiscard.verify.cpp
index c54232d51..0af445966 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/nodiscard.verify.cpp
@@ -14,10 +14,7 @@
 
 #include <iostream>
 
-struct testbuf
-    : public std::basic_streambuf<char>
-{};
-
+struct testbuf : public std::basic_streambuf<char> {};
 
 void test() {
   testbuf sbuf;
diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
index 91af5a3ad..3fd051bfe 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
@@ -77,7 +77,7 @@ int main(int, char**)
         is.exceptions(std::ios_base::eofbit);
         bool threw = false;
         try {
-            (void)is.peek();
+          (void)is.peek();
         } catch (std::ios_base::failure&) {
             threw = true;
         }
@@ -93,7 +93,7 @@ int main(int, char**)
         is.exceptions(std::ios_base::eofbit);
         bool threw = false;
         try {
-            (void)is.peek();
+          (void)is.peek();
         } catch (std::ios_base::failure&) {
             threw = true;
         }

``````````

</details>


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


More information about the libcxx-commits mailing list