summaryrefslogtreecommitdiff
path: root/clang-tools-extra/test
diff options
context:
space:
mode:
authorJonas Toth <jonas.toth@gmail.com>2019-01-09 21:03:54 +0000
committerJonas Toth <jonas.toth@gmail.com>2019-01-09 21:03:54 +0000
commitd29212aece06b5816e9bc1aa5026b104bae2729c (patch)
tree49d1356b92b687099bea97991c95164554452d65 /clang-tools-extra/test
parent4ef375c2a4bbee9e793f9f6970aef044de0e261b (diff)
[clang-tidy] fix-up failing tests
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp2
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-use-nodiscard.cpp14
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-use-nodiscard.h5
3 files changed, 11 insertions, 10 deletions
diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp
index 1a72bf4936a..cbf0cead055 100644
--- a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp
+++ b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard-cxx11.cpp
@@ -1,6 +1,6 @@
// RUN: %check_clang_tidy %s modernize-use-nodiscard %t -- \
// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: '__attribute__((warn_unused_result))'}]}" \
-// RUN: -- -std=c++11 \
+// RUN: -- -std=c++11
class Foo
{
diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard.cpp
index f4408320154..a571f096363 100644
--- a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard.cpp
+++ b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard.cpp
@@ -2,14 +2,20 @@
// RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: 'NO_DISCARD'}]}" \
// RUN: -- -std=c++17
-#include <functional>
+namespace std {
+template <class>
+class function;
+class string {};
+}
namespace boost {
template <class>
class function;
}
-#include "modernize-use-nodiscard.h"
+#define MUST_USE_RESULT __attribute__((warn_unused_result))
+#define NO_DISCARD [[nodiscard]]
+#define NO_RETURN [[noreturn]]
#define BOOLEAN_FUNC bool f23() const
@@ -168,9 +174,9 @@ auto lambda1b = []() { return true;};
auto get_functor = [](bool check) {
return [&](const std::string& sr)->std::string {
if(check){
- return "some string";
+ return std::string();
}
- return "another string";
+ return std::string();
};
};
diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard.h b/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard.h
deleted file mode 100644
index 56f3c296023..00000000000
--- a/clang-tools-extra/test/clang-tidy/modernize-use-nodiscard.h
+++ /dev/null
@@ -1,5 +0,0 @@
-
-#define MUST_USE_RESULT __attribute__((warn_unused_result))
-#define NO_DISCARD [[nodiscard]]
-#define NO_RETURN [[noreturn]]
-