summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-25 14:08:33 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-05-28 16:33:45 +0200
commit3341435d7916c209c7613d594f78059ba112495b (patch)
treea1a38bc474ff0f659204d13db30ea2d14f958c3f /compilerplugins
parent20c6ab6b492d360faafeb857ef51bc0da5f645f6 (diff)
loplugin:passstuffbyref
Change-Id: I785e96599bbda029adf4698d11d7f981750dec07 Reviewed-on: https://gerrit.libreoffice.org/54802 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit ff3bdde2527123fc9e011ff0d93e958174632186) Reviewed-on: https://gerrit.libreoffice.org/54914 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/passstuffbyref.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx
index 8cfae946f041..61bd3cf0f00c 100644
--- a/compilerplugins/clang/passstuffbyref.cxx
+++ b/compilerplugins/clang/passstuffbyref.cxx
@@ -274,6 +274,10 @@ void PassStuffByRef::checkReturnValue(const FunctionDecl * functionDecl, const C
if (startswith(type.getAsString(), "struct o3tl::strong_int")) {
return;
}
+ // extremely simple class, might as well pass by value
+ if (loplugin::TypeCheck(functionDecl->getReturnType()).Class("Color")) {
+ return;
+ }
// functionDecl->dump();