From 2f13e790839f1b3f975a254ffd4c29a171ab9204 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Thu, 16 Nov 2017 05:48:32 +0000 Subject: More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in filesystem::path llvm-svn: 318378 --- libcxx/include/experimental/filesystem | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libcxx/include/experimental/filesystem') diff --git a/libcxx/include/experimental/filesystem b/libcxx/include/experimental/filesystem index 747f62f2268..674490f6038 100644 --- a/libcxx/include/experimental/filesystem +++ b/libcxx/include/experimental/filesystem @@ -972,7 +972,8 @@ public: _LIBCPP_INLINE_VISIBILITY path extension() const { return string_type(__extension()); } // query - _LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT { return __pn_.empty(); } + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY + bool empty() const _NOEXCEPT { return __pn_.empty(); } _LIBCPP_INLINE_VISIBILITY bool has_root_name() const { return !__root_name().empty(); } _LIBCPP_INLINE_VISIBILITY bool has_root_directory() const { return !__root_directory().empty(); } -- cgit v1.2.3