summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra')
-rw-r--r--clang-tools-extra/clang-tidy/modernize/UseDefaultCheck.cpp1
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-use-default-delayed.cpp8
2 files changed, 9 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/UseDefaultCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseDefaultCheck.cpp
index 68ead15e224..dbc84ef3a87 100644
--- a/clang-tools-extra/clang-tidy/modernize/UseDefaultCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/UseDefaultCheck.cpp
@@ -272,6 +272,7 @@ void UseDefaultCheck::check(const MatchFinder::MatchResult &Result) {
// that are not user-provided (automatically generated).
if (SpecialFunctionDecl->isDeleted() ||
SpecialFunctionDecl->isExplicitlyDefaulted() ||
+ SpecialFunctionDecl->isLateTemplateParsed() ||
!SpecialFunctionDecl->isUserProvided() || !SpecialFunctionDecl->hasBody())
return;
diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-default-delayed.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-default-delayed.cpp
new file mode 100644
index 00000000000..c7163e8d934
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/modernize-use-default-delayed.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-tidy %s -checks=-*,modernize-use-default -- -std=c++11 -fdelayed-template-parsing -fexceptions | count 0
+// Note: this test expects no diagnostics, but FileCheck cannot handle that,
+// hence the use of | count 0.
+
+template <typename Ty>
+struct S {
+ S<Ty>& operator=(const S<Ty>&) { return *this; }
+};
OpenPOWER on IntegriCloud