From ff3bdde2527123fc9e011ff0d93e958174632186 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 25 May 2018 14:08:33 +0200 Subject: loplugin:passstuffbyref Change-Id: I785e96599bbda029adf4698d11d7f981750dec07 Reviewed-on: https://gerrit.libreoffice.org/54802 Tested-by: Jenkins Reviewed-by: Noel Grandin --- compilerplugins/clang/passstuffbyref.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compilerplugins/clang/passstuffbyref.cxx') 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(); -- cgit