diff options
author | Sergio Martins <smartins@kde.org> | 2016-03-05 12:13:47 +0000 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2016-03-05 12:13:47 +0000 |
commit | 93c3143dae029044459a29d1b2889a37bea923a2 (patch) | |
tree | 1f5c4130ddaf83bc7707281632d63882e40187bc /tests/function-args-by-ref | |
parent | f7f2d0ffde5044b6477b26297a5ab5c3bb6c63d1 (diff) |
Introducing function-args-by-value
This is nothing new, just splitted function-args-by-ref into two checks.
This is because a non-trivial type missing by-ref is worse than a trivial
small type being passed by-ref.
You always want to use function-args-by-ref check, while passing small trivial
types by value can have some drawbacks.
Diffstat (limited to 'tests/function-args-by-ref')
-rw-r--r-- | tests/function-args-by-ref/lambdas.cpp.expected | 1 | ||||
-rw-r--r-- | tests/function-args-by-ref/main.cpp.expected | 6 | ||||
-rw-r--r-- | tests/function-args-by-ref/sharedptrs.cpp.expected | 1 |
3 files changed, 0 insertions, 8 deletions
diff --git a/tests/function-args-by-ref/lambdas.cpp.expected b/tests/function-args-by-ref/lambdas.cpp.expected index 5c1659ac..847268e7 100644 --- a/tests/function-args-by-ref/lambdas.cpp.expected +++ b/tests/function-args-by-ref/lambdas.cpp.expected @@ -1,2 +1 @@ -function-args-by-ref/lambdas.cpp:12:18: warning: Pass small and trivially-copyable type by value (const struct Trivial &) [-Wclazy-function-args-by-ref] function-args-by-ref/lambdas.cpp:15:18: warning: Missing reference on non-trivial type (struct NonTrivial) [-Wclazy-function-args-by-ref] diff --git a/tests/function-args-by-ref/main.cpp.expected b/tests/function-args-by-ref/main.cpp.expected index 991ffb8a..34fb0834 100644 --- a/tests/function-args-by-ref/main.cpp.expected +++ b/tests/function-args-by-ref/main.cpp.expected @@ -7,10 +7,4 @@ function-args-by-ref/main.cpp:75:11: warning: Missing reference on non-trivial t function-args-by-ref/main.cpp:102:12: warning: Missing reference on non-trivial type (class QString) [-Wclazy-function-args-by-ref] function-args-by-ref/main.cpp:121:35: warning: Missing reference on non-trivial type (struct NoUserCtorsButNotTrivial) [-Wclazy-function-args-by-ref] function-args-by-ref/main.cpp:145:39: warning: Missing reference on non-trivial type (struct DefaultButNotTrivialCopyable) [-Wclazy-function-args-by-ref] -function-args-by-ref/main.cpp:150:22: warning: Pass small and trivially-copyable type by value (const struct Trivial &) [-Wclazy-function-args-by-ref] -function-args-by-ref/main.cpp:166:11: warning: Pass small and trivially-copyable type by value (const struct Trivial &) [-Wclazy-function-args-by-ref] -function-args-by-ref/main.cpp:170:11: warning: Pass small and trivially-copyable type by value (const struct Trivial &) [-Wclazy-function-args-by-ref] -function-args-by-ref/main.cpp:174:11: warning: Pass small and trivially-copyable type by value (const struct Trivial &) [-Wclazy-function-args-by-ref] -function-args-by-ref/main.cpp:184:16: warning: Pass small and trivially-copyable type by value (const struct Trivial &) [-Wclazy-function-args-by-ref] -function-args-by-ref/main.cpp:193:19: warning: Pass small and trivially-copyable type by value (const struct Trivial &) [-Wclazy-function-args-by-ref] function-args-by-ref/main.cpp:214:12: warning: Missing reference on non-trivial type (struct NonTrivial) [-Wclazy-function-args-by-ref] diff --git a/tests/function-args-by-ref/sharedptrs.cpp.expected b/tests/function-args-by-ref/sharedptrs.cpp.expected index 84fe799d..e69de29b 100644 --- a/tests/function-args-by-ref/sharedptrs.cpp.expected +++ b/tests/function-args-by-ref/sharedptrs.cpp.expected @@ -1 +0,0 @@ -function-args-by-ref/sharedptrs.cpp:7:11: warning: Pass small and trivially-copyable type by value (const struct Trivial &) [-Wclazy-function-args-by-ref] |