Bug 458797

Summary: Applying copyable-polymorphic fixit introduces compiler warning
Product: [Developer tools] clazy Reporter: a.saoutkin
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: REPORTED ---    
Severity: normal CC: smartins
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Expected diff produced by the fixit
Actual diff produced by the fixit

Description a.saoutkin 2022-09-06 15:49:52 UTC
Created attachment 151869 [details]
Expected diff produced by the fixit

SUMMARY
Applying the copyable-polymorphic fixit ironically introduces a compiler warning.

STEPS TO REPRODUCE
1. git clone https://invent.kde.org/system/kio-fuse
2. git reset --hard fbd09a339f9880fe8d018001d4d2561593f90530
3. export CLAZY_EXPORT_FIXES=ON && export CLAZY_CHECKS="copyable-polymorphic"
4. mkdir build && cd build && cmake .. -DCMAKE_CXX_COMPILER=clazy && make
4. clang-apply-replacements ..
5. make

OBSERVED RESULT
diff titled "actual.patch", which produces the following warning when built:
kiofusenode.h:44:2: warning: explicitly defaulted default constructor is implicitly deleted [-Wdefaulted-function-deleted]
        KIOFuseDirNode() = default;

EXPECTED RESULT
diff titled "expected.patch", which produces no warning when built

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04
(available in About System)
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Clazy Version: 1.11
Ubuntu clang version 14.0.0-1ubuntu1
ADDITIONAL INFORMATION
Comment 1 a.saoutkin 2022-09-06 15:50:30 UTC
Created attachment 151870 [details]
Actual diff produced by the fixit
Comment 2 a.saoutkin 2022-09-06 15:57:49 UTC
Looking deeper, seems that not doing what is currently done can produce compiler errors. In my case, it doesn't so no need to add a default constructor. I wonder if there's a sane middle ground here.