diff options
author | Haojian Wu <hokein@google.com> | 2017-03-06 14:46:44 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2017-03-06 14:46:44 +0000 |
commit | 1aa5885f00bdd926357aade401cdb458cf102785 (patch) | |
tree | f1c6d9868275c3a1056223c2d52b3b94c079271a /clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp | |
parent | c215a2ac404adf37f6fa33d00cb9aabce5cad5b0 (diff) | |
download | bcm5719-llvm-1aa5885f00bdd926357aade401cdb458cf102785.tar.gz bcm5719-llvm-1aa5885f00bdd926357aade401cdb458cf102785.zip |
[clang-tidy] Ignore substituted template types in modernize-use-nullptr check.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: xazax.hun, malcolm.parsons, JDevlieghere, cfe-commits
Differential Revision: https://reviews.llvm.org/D30639
llvm-svn: 297009
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 | 17 |
1 files changed, 17 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 42cdb2d5fe8..7e1eb1459c0 100644 --- a/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.cpp @@ -244,3 +244,20 @@ void f() { bool a; a = ZZ(Hash()); } + +// Test on ignoring substituted template types. +template<typename T> +class TemplateClass { + public: + explicit TemplateClass(int a, T default_value = 0) {} + + void h(T *default_value = 0) {} + + void f(int* p = 0) {} +// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: use nullptr +// CHECK-FIXES: void f(int* p = nullptr) {} +}; + +void IgnoreSubstTemplateType() { + TemplateClass<int*> a(1); +} |