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 | 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); +} |