diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/checkers/modernize/use-nullptr.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/checkers/modernize/use-nullptr.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-nullptr.cpp b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-nullptr.cpp index fe9d6de..27a9629 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-nullptr.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-nullptr.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy --match-partial-fixes %s modernize-use-nullptr %t -- \ +// RUN: %check_clang_tidy %s modernize-use-nullptr %t -- \ // RUN: -config="{CheckOptions: {modernize-use-nullptr.NullMacros: 'MY_NULL,NULL'}}" #define NULL 0 @@ -91,7 +91,7 @@ template <typename T> struct pear { // it is often defined as __null and the check will catch it.) void f() { x = __null; } // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: use nullptr [modernize-use-nullptr] - // CHECK-FIXES: x = nullptr; + // CHECK-FIXES: void f() { x = nullptr; } // But if you say 0, we allow the possibility that T can be used with integral // and pointer types, and "0" is an acceptable initializer (even if "{}" might @@ -118,11 +118,13 @@ void test_macro_args() { // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: use nullptr // CHECK-FIXES: IS_EQ(static_cast<int*>(nullptr), Ptr); - IS_EQ(0, Ptr); // literal + // literal + IS_EQ(0, Ptr); // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use nullptr // CHECK-FIXES: IS_EQ(nullptr, Ptr); - IS_EQ(NULL, Ptr); // macro + // macro + IS_EQ(NULL, Ptr); // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use nullptr // CHECK-FIXES: IS_EQ(nullptr, Ptr); @@ -205,7 +207,7 @@ void test_macro_args() { } a[2] = {ENTRY(0), {0}}; // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: use nullptr // CHECK-MESSAGES: :[[@LINE-2]]:24: warning: use nullptr - // CHECK-FIXES: a[2] = {ENTRY(nullptr), {nullptr}}; + // CHECK-FIXES: } a[2] = {ENTRY(nullptr), {nullptr}}; #undef ENTRY #define assert1(expr) (expr) ? 0 : 1 |