diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp index e1267bf9a5a..e1ab843404e 100644 --- a/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp @@ -217,3 +217,14 @@ C<bool, F(0)> c; // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: use nullptr // CHECK-FIXES: C<bool, F(nullptr)> c; #undef F + +// Test default argument expression. +struct D { + explicit D(void *t, int *c = NULL) {} + // CHECK-MESSAGES: :[[@LINE-1]]:32: warning: use nullptr + // CHECK-FIXES: explicit D(void *t, int *c = nullptr) {} +}; + +void test_default_argument() { + D(nullptr); +} |