Skip to content

Commit 1749811

Browse files
committed
test_limit_reference: Avoid virtual-move-assign warning
"= delete" Bases's move operations because the defaulted one would call non-trivial assignment operators in the virtual bases. This avoids this compiler warning, at least with g++ 9.2: test_limit_reference.cc:12:7: error: defaulted move assignment for ‘{anonymous}::Base’ calls a non-trivial move assignment operator for virtual base ‘sigc::trackable’ [-Werror=virtual-move-assign] 12 | class Base : virtual public sigc::trackable | ^~~~ test_limit_reference.cc:22:7: error: defaulted move assignment for ‘{anonymous}::Derived’ calls a non-trivial move assignment operator for virtual base ‘{anonymous}::Base’ [-Werror=virtual-move-assign] 22 | class Derived : virtual public Base, public Base2 It would be nice if this test had a comment saying what it is testing.
1 parent fcdc822 commit 1749811

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_limit_reference.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ std::ostringstream result_stream;
1111

1212
class Base : virtual public sigc::trackable
1313
{
14+
public:
15+
Base() {}
16+
17+
Base(Base&& src) = delete;
18+
Base& operator=(Base&& src) = delete;
1419
};
1520

1621
class Base2

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy