diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 15:06:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 16:59:09 +0200 |
commit | 385a248513da5984d5c05301ae9d50a7876a826f (patch) | |
tree | 72c0335d37e77ec74b0b48332634e33f4e8153e3 | |
parent | a8174d258d4ad1f151a245b80e5a9bbddc731f2a (diff) |
Do not warn about Link<Window *>
Change-Id: Id26adce17a2479eead935958556012f13f2821b7
-rw-r--r-- | compilerplugins/clang/vclwidgets.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx index a2f4ee15855e..d239c67c67e3 100644 --- a/compilerplugins/clang/vclwidgets.cxx +++ b/compilerplugins/clang/vclwidgets.cxx @@ -105,12 +105,17 @@ bool containsWindowSubclass(const Type* pType0) { if (pRecordDecl) { const ClassTemplateSpecializationDecl* pTemplate = dyn_cast<ClassTemplateSpecializationDecl>(pRecordDecl); if (pTemplate) { + bool link = pTemplate->getQualifiedNameAsString() == "Link"; for(unsigned i=0; i<pTemplate->getTemplateArgs().size(); ++i) { const TemplateArgument& rArg = pTemplate->getTemplateArgs()[i]; if (rArg.getKind() == TemplateArgument::ArgKind::Type && containsWindowSubclass(rArg.getAsType())) { - return true; + // OK for first template argument of tools/link.hxx Link + // to be a Window-derived pointer: + if (!link || i != 0) { + return true; + } } } } |