From 31a4b79abee5fff1fe01b78b98a5d5eecdecea74 Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Wed, 26 Nov 2025 08:19:57 +0200 Subject: [PATCH 1/4] [libc++] Applied `[[nodiscard]]` to Language Support (partially) https://wg21.link/#support `[[nodiscard]]` should be applied to functions where discarding the return value is most likely a correctness issue. - https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant The following was implemented in this patch: - [x] `` - [x] `` - [x] `` - [x] Integer comparisons --- libcxx/include/__compare/is_eq.h | 12 +-- libcxx/include/__coroutine/coroutine_handle.h | 18 ++-- .../__coroutine/noop_coroutine_handle.h | 10 +- libcxx/include/__utility/cmp.h | 14 +-- libcxx/include/initializer_list | 12 ++- .../diagnostics/utility.nodiscard.verify.cpp | 28 ++++-- .../language.support/nodiscard.verify.cpp | 94 +++++++++++++++++++ 7 files changed, 153 insertions(+), 35 deletions(-) create mode 100644 libcxx/test/libcxx/language.support/nodiscard.verify.cpp diff --git a/libcxx/include/__compare/is_eq.h b/libcxx/include/__compare/is_eq.h index 9a82df1ebe88b..ee4d11bc7c792 100644 --- a/libcxx/include/__compare/is_eq.h +++ b/libcxx/include/__compare/is_eq.h @@ -20,12 +20,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 -_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; } -_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; } -_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lt(partial_ordering __c) noexcept { return __c < 0; } -_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexcept { return __c <= 0; } -_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; } -_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; } +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; } +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; } +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lt(partial_ordering __c) noexcept { return __c < 0; } +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexcept { return __c <= 0; } +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; } +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; } #endif // _LIBCPP_STD_VER >= 20 diff --git a/libcxx/include/__coroutine/coroutine_handle.h b/libcxx/include/__coroutine/coroutine_handle.h index b7add258510eb..b26a650748832 100644 --- a/libcxx/include/__coroutine/coroutine_handle.h +++ b/libcxx/include/__coroutine/coroutine_handle.h @@ -44,9 +44,9 @@ struct coroutine_handle { } // [coroutine.handle.export.import], export/import - _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; } - _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address(void* __addr) noexcept { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address(void* __addr) noexcept { coroutine_handle __tmp; __tmp.__handle_ = __addr; return __tmp; @@ -55,7 +55,7 @@ struct coroutine_handle { // [coroutine.handle.observers], observers _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return __handle_ != nullptr; } - _LIBCPP_HIDE_FROM_ABI bool done() const { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool done() const { _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL(__is_suspended(), "done() can be called only on suspended coroutines"); return __builtin_coro_done(__handle_); } @@ -100,7 +100,7 @@ struct coroutine_handle { _LIBCPP_HIDE_FROM_ABI constexpr coroutine_handle(nullptr_t) noexcept {} - _LIBCPP_HIDE_FROM_ABI static coroutine_handle from_promise(_Promise& __promise) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static coroutine_handle from_promise(_Promise& __promise) { using _RawPromise = __remove_cv_t<_Promise>; coroutine_handle __tmp; __tmp.__handle_ = @@ -114,9 +114,9 @@ struct coroutine_handle { } // [coroutine.handle.export.import], export/import - _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; } - _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address(void* __addr) noexcept { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr coroutine_handle from_address(void* __addr) noexcept { coroutine_handle __tmp; __tmp.__handle_ = __addr; return __tmp; @@ -130,7 +130,7 @@ struct coroutine_handle { // [coroutine.handle.observers], observers _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return __handle_ != nullptr; } - _LIBCPP_HIDE_FROM_ABI bool done() const { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool done() const { _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL(__is_suspended(), "done() can be called only on suspended coroutines"); return __builtin_coro_done(__handle_); } @@ -150,7 +150,7 @@ struct coroutine_handle { } // [coroutine.handle.promise], promise access - _LIBCPP_HIDE_FROM_ABI _Promise& promise() const { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Promise& promise() const { return *static_cast<_Promise*>(__builtin_coro_promise(this->__handle_, alignof(_Promise), false)); } @@ -165,7 +165,7 @@ struct coroutine_handle { // [coroutine.handle.hash] template struct hash> { - _LIBCPP_HIDE_FROM_ABI size_t operator()(const coroutine_handle<_Tp>& __v) const noexcept { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI size_t operator()(const coroutine_handle<_Tp>& __v) const noexcept { return hash()(__v.address()); } }; diff --git a/libcxx/include/__coroutine/noop_coroutine_handle.h b/libcxx/include/__coroutine/noop_coroutine_handle.h index 692398a8a8431..b9c54d3b42bef 100644 --- a/libcxx/include/__coroutine/noop_coroutine_handle.h +++ b/libcxx/include/__coroutine/noop_coroutine_handle.h @@ -35,7 +35,7 @@ struct coroutine_handle { // [coroutine.handle.noop.observers], observers _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return true; } - _LIBCPP_HIDE_FROM_ABI constexpr bool done() const noexcept { return false; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool done() const noexcept { return false; } // [coroutine.handle.noop.resumption], resumption _LIBCPP_HIDE_FROM_ABI constexpr void operator()() const noexcept {} @@ -43,13 +43,13 @@ struct coroutine_handle { _LIBCPP_HIDE_FROM_ABI constexpr void destroy() const noexcept {} // [coroutine.handle.noop.promise], promise access - _LIBCPP_HIDE_FROM_ABI noop_coroutine_promise& promise() const noexcept { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI noop_coroutine_promise& promise() const noexcept { return *static_cast( __builtin_coro_promise(this->__handle_, alignof(noop_coroutine_promise), false)); } // [coroutine.handle.noop.address], address - _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr void* address() const noexcept { return __handle_; } private: _LIBCPP_HIDE_FROM_ABI friend coroutine_handle noop_coroutine() noexcept; @@ -86,7 +86,9 @@ inline noop_coroutine_handle::__noop_coroutine_frame_ty_ noop_coroutine_handle:: # endif // [coroutine.noop.coroutine] -inline _LIBCPP_HIDE_FROM_ABI noop_coroutine_handle noop_coroutine() noexcept { return noop_coroutine_handle(); } +[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI noop_coroutine_handle noop_coroutine() noexcept { + return noop_coroutine_handle(); +} _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__utility/cmp.h b/libcxx/include/__utility/cmp.h index 68864e23e0397..7cfe640ceb423 100644 --- a/libcxx/include/__utility/cmp.h +++ b/libcxx/include/__utility/cmp.h @@ -31,7 +31,7 @@ concept __comparison_can_promote_to = sizeof(_Tp) < sizeof(_Ip) || (sizeof(_Tp) == sizeof(_Ip) && __signed_integer<_Tp>); template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up> -_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>) return __t == __u; else if constexpr (__comparison_can_promote_to<_Tp, int> && __comparison_can_promote_to<_Up, int>) @@ -45,12 +45,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { } template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up> -_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcept { return !std::cmp_equal(__t, __u); } template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up> -_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>) return __t < __u; else if constexpr (__comparison_can_promote_to<_Tp, int> && __comparison_can_promote_to<_Up, int>) @@ -64,22 +64,22 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { } template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up> -_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater(_Tp __t, _Up __u) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater(_Tp __t, _Up __u) noexcept { return std::cmp_less(__u, __t); } template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up> -_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less_equal(_Tp __t, _Up __u) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less_equal(_Tp __t, _Up __u) noexcept { return !std::cmp_greater(__t, __u); } template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up> -_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater_equal(_Tp __t, _Up __u) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater_equal(_Tp __t, _Up __u) noexcept { return !std::cmp_less(__t, __u); } template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up> -_LIBCPP_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept { +[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept { return std::cmp_less_equal(__u, numeric_limits<_Tp>::max()) && std::cmp_greater_equal(__u, numeric_limits<_Tp>::min()); } diff --git a/libcxx/include/initializer_list b/libcxx/include/initializer_list index 00e0d4ea4a2df..44cd45668388b 100644 --- a/libcxx/include/initializer_list +++ b/libcxx/include/initializer_list @@ -78,11 +78,17 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {} - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t size() const _NOEXCEPT { return __size_; } + [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t size() const _NOEXCEPT { + return __size_; + } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin() const _NOEXCEPT { return __begin_; } + [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin() const _NOEXCEPT { + return __begin_; + } - _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end() const _NOEXCEPT { return __begin_ + __size_; } + [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end() const _NOEXCEPT { + return __begin_ + __size_; + } }; template diff --git a/libcxx/test/libcxx/diagnostics/utility.nodiscard.verify.cpp b/libcxx/test/libcxx/diagnostics/utility.nodiscard.verify.cpp index 524be96736bad..2f5b3ba0fc642 100644 --- a/libcxx/test/libcxx/diagnostics/utility.nodiscard.verify.cpp +++ b/libcxx/test/libcxx/diagnostics/utility.nodiscard.verify.cpp @@ -10,8 +10,6 @@ // check that functions are marked [[nodiscard]] -// clang-format off - #include #include "test_macros.h" @@ -19,15 +17,33 @@ void test() { int i = 0; - std::forward(i); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} - std::forward(1); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} - std::move(i); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} - std::move_if_noexcept(i); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + std::forward(i); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + std::forward(1); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + std::move(i); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::move_if_noexcept(i); #if TEST_STD_VER >= 17 std::as_const(i); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} #endif +#if TEST_STD_VER >= 20 + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::cmp_equal(94, 82); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::cmp_not_equal(94, 82); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::cmp_less(94, 82); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::cmp_greater(94, 82); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::cmp_less_equal(94, 82); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::cmp_greater_equal(94, 82); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::in_range(49); +#endif + #if TEST_STD_VER >= 23 enum E { Apple, Orange } e = Apple; std::to_underlying(e); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} diff --git a/libcxx/test/libcxx/language.support/nodiscard.verify.cpp b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp new file mode 100644 index 0000000000000..fb0676dc7cadb --- /dev/null +++ b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp @@ -0,0 +1,94 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++03 + +// check that functions are marked [[nodiscard]] + +#include +#include +#include +#include +#include + +#include "test_macros.h" + +void test() { +#if TEST_STD_VER >= 20 + { // + int x = 94; + int y = 82; + auto oRes = x <=> y; + + std::is_eq(oRes); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + std::is_neq(oRes); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + std::is_lt(oRes); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + std::is_lteq(oRes); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + std::is_gt(oRes); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + std::is_gteq(oRes); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + } +#endif + +#if TEST_STD_VER >= 20 + { // + struct EmptyPromise { + } promise; + + { + std::coroutine_handle cr{}; + + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + cr.address(); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::coroutine_handle::from_address(&promise); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + cr.done(); + + std::hash> hash; + hash(cr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + } + { + std::coroutine_handle cr; + + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::coroutine_handle::from_promise(promise); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + cr.address(); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::coroutine_handle::from_address(&promise); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + cr.done(); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + cr.promise(); + } + { + std::coroutine_handle cr = std::noop_coroutine(); + + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + cr.done(); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + cr.promise(); + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + cr.address(); + + // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}} + std::noop_coroutine(); + } + } +#endif + +#if TEST_STD_VER >= 20 + { // + std::initializer_list il{94, 82, 49}; + + il.size(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + il.begin(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + il.end(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + } +#endif +} From 32f3d2e489323170bbc2b927d027798a8524deca Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Wed, 26 Nov 2025 09:56:50 +0200 Subject: [PATCH 2/4] Fixed build --- libcxx/test/libcxx/language.support/nodiscard.verify.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libcxx/test/libcxx/language.support/nodiscard.verify.cpp b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp index fb0676dc7cadb..a39753e79291d 100644 --- a/libcxx/test/libcxx/language.support/nodiscard.verify.cpp +++ b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include "test_macros.h" From 35d6208710cae4ef23408b304550a80fdbe4a580 Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Wed, 26 Nov 2025 12:04:17 +0200 Subject: [PATCH 3/4] Update libcxx/test/libcxx/language.support/nodiscard.verify.cpp Co-authored-by: A. Jiang --- libcxx/test/libcxx/language.support/nodiscard.verify.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libcxx/test/libcxx/language.support/nodiscard.verify.cpp b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp index a39753e79291d..76a889ba4bfde 100644 --- a/libcxx/test/libcxx/language.support/nodiscard.verify.cpp +++ b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp @@ -81,7 +81,6 @@ void test() { } #endif -#if TEST_STD_VER >= 20 { // std::initializer_list il{94, 82, 49}; @@ -89,5 +88,4 @@ void test() { il.begin(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} il.end(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} } -#endif } From d236226825d10a95a1250a0f02d4a77c259c863a Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Wed, 26 Nov 2025 12:05:46 +0200 Subject: [PATCH 4/4] Apply suggestion from @Zingam --- libcxx/test/libcxx/language.support/nodiscard.verify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/test/libcxx/language.support/nodiscard.verify.cpp b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp index 76a889ba4bfde..b87b04ad9f1ef 100644 --- a/libcxx/test/libcxx/language.support/nodiscard.verify.cpp +++ b/libcxx/test/libcxx/language.support/nodiscard.verify.cpp @@ -8,7 +8,7 @@ // UNSUPPORTED: c++03 -// check that functions are marked [[nodiscard]] +// Check that functions are marked [[nodiscard]] #include #include