summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/passstuffbyref.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx
index cff1e781455c..d6ab91fc82a1 100644
--- a/compilerplugins/clang/passstuffbyref.cxx
+++ b/compilerplugins/clang/passstuffbyref.cxx
@@ -286,8 +286,17 @@ void PassStuffByRef::checkReturnValue(const FunctionDecl * functionDecl, const C
if (startswith(type.getAsString(), "struct o3tl::strong_int")) {
return;
}
+ auto tc = loplugin::TypeCheck(functionDecl->getReturnType());
+ // these functions are passed by function-pointer
+ if (functionDecl->getIdentifier() && functionDecl->getName() == "GetRanges"
+ && tc.Struct("WhichRangesContainer").GlobalNamespace())
+ return;
+ // extremely simple class, might as well pass by value
+ if (tc.Class("Color")) {
+ return;
+ }
// extremely simple class, might as well pass by value
- if (loplugin::TypeCheck(functionDecl->getReturnType()).Class("Color")) {
+ if (tc.Struct("TranslateId")) {
return;
}