Make modernize-use-default tolerant of delayed template parsing; this code was previously causing failed assertions because dyn_cast was being passed a null pointer due to the delay-parsed body.
llvm-svn: 258356
This commit is contained in:
parent
9fb70f53ce
commit
b61829887d
|
@ -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;
|
||||
|
||||
|
|
|
@ -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; }
|
||||
};
|
Loading…
Reference in New Issue