Bug 388677

Summary: rule-of-three warning in class that is not copyable
Product: [Developer tools] clazy Reporter: Albert Astals Cid <aacid>
Component: generalAssignee: Sergio Martins <smartins>
Status: RESOLVED FIXED    
Severity: normal CC: smartins
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: main.cpp

Description Albert Astals Cid 2018-01-08 13:10:54 UTC
Created attachment 109734 [details]
main.cpp

Clazy says

main.cpp:19:1: warning: B has dtor but not copy-ctor, copy-assignment [-Wclazy-rule-of-three]
class B : public A
^
1 warning generated.

on the attached code.

I think the warning doesn't make sense since B is not copyable (as demonstrated if you uncomment the commented code in main)
Comment 1 Sergio Martins 2018-01-08 18:32:04 UTC
commit 0e86a561361f1cafc2680d3966cd126c5cd9034e (HEAD -> 1.3, origin/1.3)
Author: Sergio Martins <smartins@kde.org>
Date:   Mon Jan 8 18:21:59 2018 +0000

    rule-of-three: Don't warn if either copy-assign or copy-ctor is deleted
    
    It's safe, as it won't happen that one of the user-methods will do
    something different from the compiler-generated-method, as one of
    them can't be called.
    
    BUG: 388677