summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r--compilerplugins/clang/passstuffbyref.cxx4
-rw-r--r--compilerplugins/clang/plugin.cxx3
-rw-r--r--compilerplugins/clang/staticmethods.cxx2
-rw-r--r--compilerplugins/clang/unnecessaryoverride.cxx8
-rw-r--r--compilerplugins/clang/weakobject.cxx4
5 files changed, 15 insertions, 6 deletions
diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx
index 2fa12db827b9..268706c3a60f 100644
--- a/compilerplugins/clang/passstuffbyref.cxx
+++ b/compilerplugins/clang/passstuffbyref.cxx
@@ -216,7 +216,9 @@ void PassStuffByRef::checkReturnValue(const FunctionDecl * functionDecl, const C
if (methodDecl && (methodDecl->isVirtual() || methodDecl->hasAttr<OverrideAttr>())) {
return;
}
- if( !functionDecl->doesThisDeclarationHaveABody()) {
+ if( !functionDecl->doesThisDeclarationHaveABody()
+ || functionDecl->isLateTemplateParsed())
+ {
return;
}
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 5bfdc4ed3a83..c9415ab13f03 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -206,7 +206,8 @@ bool ParentBuilder::VisitFunctionDecl( const FunctionDecl* function )
{
// if( ignoreLocation( declaration ))
// return true; ???
- if( function->doesThisDeclarationHaveABody())
+ if( function->doesThisDeclarationHaveABody()
+ && !function->isLateTemplateParsed())
{
const Stmt* body = function->getBody();
(*parents)[ body ] = NULL; // no parent
diff --git a/compilerplugins/clang/staticmethods.cxx b/compilerplugins/clang/staticmethods.cxx
index 6360295968bd..cbd395845808 100644
--- a/compilerplugins/clang/staticmethods.cxx
+++ b/compilerplugins/clang/staticmethods.cxx
@@ -78,7 +78,7 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
if (ignoreLocation(pCXXMethodDecl)) {
return true;
}
- if (!pCXXMethodDecl->isInstance() || pCXXMethodDecl->isVirtual() || !pCXXMethodDecl->hasBody()) {
+ if (!pCXXMethodDecl->isInstance() || pCXXMethodDecl->isVirtual() || !pCXXMethodDecl->doesThisDeclarationHaveABody() || pCXXMethodDecl->isLateTemplateParsed()) {
return true;
}
if (pCXXMethodDecl->getOverloadedOperator() != OverloadedOperatorKind::OO_None || pCXXMethodDecl->hasAttr<OverrideAttr>()) {
diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx
index 98b51a03a18b..0b1f572560c2 100644
--- a/compilerplugins/clang/unnecessaryoverride.cxx
+++ b/compilerplugins/clang/unnecessaryoverride.cxx
@@ -155,7 +155,9 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl)
return true;
}
if (!methodDecl->isExplicitlyDefaulted()) {
- if (!methodDecl->doesThisDeclarationHaveABody()) {
+ if (!methodDecl->doesThisDeclarationHaveABody()
+ || methodDecl->isLateTemplateParsed())
+ {
return true;
}
auto stmt = dyn_cast<CompoundStmt>(methodDecl->getBody());
@@ -194,7 +196,9 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl)
return true;
}
- if (!methodDecl->doesThisDeclarationHaveABody()) {
+ if (!methodDecl->doesThisDeclarationHaveABody()
+ || methodDecl->isLateTemplateParsed())
+ {
return true;
}
diff --git a/compilerplugins/clang/weakobject.cxx b/compilerplugins/clang/weakobject.cxx
index 9ccbb8ac3c86..889835051c10 100644
--- a/compilerplugins/clang/weakobject.cxx
+++ b/compilerplugins/clang/weakobject.cxx
@@ -57,7 +57,9 @@ public:
if (ignoreLocation(pMethodDecl)) {
return true;
}
- if (!pMethodDecl->isThisDeclarationADefinition()) {
+ if (!pMethodDecl->isThisDeclarationADefinition()
+ || pMethodDecl->isLateTemplateParsed())
+ {
return true;
}
if (!pMethodDecl->isInstance()) {