diff options
author | Haojian Wu <hokein@google.com> | 2016-11-07 21:46:24 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2016-11-07 21:46:24 +0000 |
commit | a29ae6f2d721f71635d6379d2d012ca2fc33ce5f (patch) | |
tree | 512274763aff22909140ad8f8020f0e1bca71be2 /clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp | |
parent | 4a3f94c442e497e5fc5a128413de14eff4cbfb98 (diff) | |
download | bcm5719-llvm-a29ae6f2d721f71635d6379d2d012ca2fc33ce5f.tar.gz bcm5719-llvm-a29ae6f2d721f71635d6379d2d012ca2fc33ce5f.zip |
[clang-tidy] Fix a regression issue introduced by r285239.
Summary:
r285239 changes the behavior of AST CXXDefaultArgExpr node.
Update `modernize-use-nullptr` to handle CXXDefaultArgExpr correctly.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26301
llvm-svn: 286156
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); +} |