summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-07-11 18:09:55 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-07-11 18:09:55 +0200
commit744c924754accf77514599f660af52480999c144 (patch)
treec15aa6b6530dffeca955aab1d53dc6c5df0a109c /compilerplugins
parentd1c0a77ed1ba96b29e9b260b9ea1696634a9a094 (diff)
Adapt to Clang 3.4 again
Change-Id: I33c1cee01593b06efca6e1aae283ce80d5cd77be
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/vclwidgets.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
index ba0c0073e798..ce2bb5572ef1 100644
--- a/compilerplugins/clang/vclwidgets.cxx
+++ b/compilerplugins/clang/vclwidgets.cxx
@@ -379,8 +379,10 @@ static void findDisposeAndClearStatements(std::set<const FieldDecl*>& aVclPtrFie
return;
if (isa<CompoundStmt>(pStmt)) {
const CompoundStmt *pCompoundStatement = dyn_cast<CompoundStmt>(pStmt);
- for(const Stmt* pStmt : pCompoundStatement->body()) {
- findDisposeAndClearStatements(aVclPtrFields, pStmt);
+ for (auto i = pCompoundStatement->body_begin();
+ i != pCompoundStatement->body_end(); ++i)
+ {
+ findDisposeAndClearStatements(aVclPtrFields, *i);
}
return;
}
@@ -459,22 +461,24 @@ bool VCLWidgets::VisitFunctionDecl( const FunctionDecl* functionDecl )
return true;
std::set<const FieldDecl*> aVclPtrFields;
- for(const auto& fieldDecl : pMethodDecl->getParent()->fields()) {
- auto const type = loplugin::TypeCheck(fieldDecl->getType());
+ for (auto i = pMethodDecl->getParent()->field_begin();
+ i != pMethodDecl->getParent()->field_end(); ++i)
+ {
+ auto const type = loplugin::TypeCheck((*i)->getType());
if (type.Class("VclPtr").GlobalNamespace()) {
- aVclPtrFields.insert(fieldDecl);
+ aVclPtrFields.insert(*i);
} else if (type.Class("vector").StdNamespace()
|| type.Class("map").StdNamespace()
|| type.Class("list").StdNamespace()
|| type.Class("set").StdNamespace())
{
- const RecordType* recordType = dyn_cast_or_null<RecordType>(fieldDecl->getType()->getUnqualifiedDesugaredType());
+ const RecordType* recordType = dyn_cast_or_null<RecordType>((*i)->getType()->getUnqualifiedDesugaredType());
if (recordType) {
auto d = dyn_cast<ClassTemplateSpecializationDecl>(recordType->getDecl());
if (d && d->getTemplateArgs().size()>0) {
auto const type = loplugin::TypeCheck(d->getTemplateArgs()[0].getAsType());
if (type.Class("VclPtr").GlobalNamespace()) {
- aVclPtrFields.insert(fieldDecl);
+ aVclPtrFields.insert(*i);
}
}
}