[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] Compiler diagnostics [Was: master 6a59da54 8/8: When in doubt, pre
From: |
Greg Chicares |
Subject: |
[lmi] Compiler diagnostics [Was: master 6a59da54 8/8: When in doubt, prefer the Rule of Five to the Rule of Zero] |
Date: |
Mon, 11 Jul 2022 19:03:25 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 |
On 7/11/22 16:22, Greg Chicares wrote:
[...]
> Experimentally, for Rule of 0-->5 changes, I copied the old dtor that I
> had removed, and added the other four members, all deleted; then I did
> s/delete/default/ as few times as possible to get everything to build.
BTW, I just wanted to mention how difficult that process can be.
For example, if we change 'fund_data.hpp' thus:
- FundInfo(FundInfo const&) = default;
+ FundInfo(FundInfo const&) = delete;
then clang's diagnostics are about thirty lines long, and only
one of those lines says that a ctor has been deleted, without
saying which one:
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_construct.h:94:5:
note: candidate template ignored: substitution failure [with _Tp = FundInfo,
_Args = <const FundInfo &>]: call to deleted constructor of 'FundInfo'
OTOH, gcc issues more lines of diagnostics than clang, but
does identify the cause directly:
/opt/lmi/src/lmi/fund_data.hpp:51:5: note: declared here
51 | FundInfo(FundInfo const&) = delete;
Some years ago, clang's diagnostics were generally better than
gcc's, but now neither one seems much better than the other.
Should I hope for better clang diagnostics if I use its
https://libcxx.llvm.org/
standard library?
- Re: [lmi] [lmi-commits] master 6a59da54 8/8: When in doubt, prefer the Rule of Five to the Rule of Zero, Vadim Zeitlin, 2022/07/11
- Re: [lmi] [lmi-commits] master 6a59da54 8/8: When in doubt, prefer the Rule of Five to the Rule of Zero, Vadim Zeitlin, 2022/07/11
- Re: [lmi] [lmi-commits] master 6a59da54 8/8: When in doubt, prefer the Rule of Five to the Rule of Zero, Greg Chicares, 2022/07/12
- Re: [lmi] [lmi-commits] master 6a59da54 8/8: When in doubt, prefer the Rule of Five to the Rule of Zero, Vadim Zeitlin, 2022/07/12
- [lmi] const or reference members [Was: When in doubt, prefer the Rule of Five to the Rule of Zero], Greg Chicares, 2022/07/12
- Re: [lmi] const or reference members, Vadim Zeitlin, 2022/07/12
- Re: [lmi] const or reference members, Greg Chicares, 2022/07/12
- Re: [lmi] const or reference members, Vadim Zeitlin, 2022/07/13