diff options
author | Sergio Martins <smartins@kde.org> | 2015-11-13 14:27:13 +0000 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2015-11-13 14:27:13 +0000 |
commit | d65fb3df0d898e25d751e0b65af700f2ce1ecf97 (patch) | |
tree | 396ee9dbb49bb7cb10b95afb2f2871e11eb60627 /tests/function-args-by-ref | |
parent | 80688d0c928f02ecc9b1fd06dc1520d1ca33bfa4 (diff) |
function-args-by-ref: Test =default ctors on non trivially-copyable types
The synthetized copy-ctor is not trivial in this case, since it has to call
the copy-ctor from the member variable.
Diffstat (limited to 'tests/function-args-by-ref')
-rw-r--r-- | tests/function-args-by-ref/main.cpp | 12 | ||||
-rw-r--r-- | tests/function-args-by-ref/test.expected | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/function-args-by-ref/main.cpp b/tests/function-args-by-ref/main.cpp index 17430a36..9f39311a 100644 --- a/tests/function-args-by-ref/main.cpp +++ b/tests/function-args-by-ref/main.cpp @@ -134,3 +134,15 @@ void testTrivialWithDefaultCopyCtorAndDtor(TrivialWithDefaultCopyCtorAndDtor) { } + +struct DefaultButNotTrivialCopyable +{ + DefaultButNotTrivialCopyable(const DefaultButNotTrivialCopyable & ) = default; + ~DefaultButNotTrivialCopyable() = default; + NonTrivial t; +}; + +void testDefaultButNotTrivialCopyable(DefaultButNotTrivialCopyable) +{ + +} diff --git a/tests/function-args-by-ref/test.expected b/tests/function-args-by-ref/test.expected index fc4aa531..c51d58a4 100644 --- a/tests/function-args-by-ref/test.expected +++ b/tests/function-args-by-ref/test.expected @@ -6,3 +6,4 @@ main.cpp:69:10: warning: Missing reference on non-trivial type NonTrivial [-Wcla main.cpp:75:11: warning: Missing reference on non-trivial type NonTrivial [-Wclazy-function-args-by-ref] main.cpp:102:12: warning: Missing reference on non-trivial type QString [-Wclazy-function-args-by-ref] main.cpp:121:35: warning: Missing reference on non-trivial type NoUserCtorsButNotTrivial [-Wclazy-function-args-by-ref] +main.cpp:145:39: warning: Missing reference on non-trivial type DefaultButNotTrivialCopyable [-Wclazy-function-args-by-ref] |