D.gnu - GCC analyzer false positive
- Iain Buclaw (6/29) Apr 29 Two releases later, I've just seen this patch land in GCC 16
https://forum.dlang.org/post/qgjyddculzfshluvsisl forum.dlang.org On Friday, 22 September 2023 at 09:11:58 UTC, Iain Buclaw wrote:On Thursday, 31 August 2023 at 13:53:55 UTC, Zachary Yedidia wrote:Two releases later, I've just seen this patch land in GCC 16 trunk, which caters for the C++ equivalent. https://gcc.gnu.org/cgit/gcc/commit/?id=a1922f0252b3b09016df76bd5b10119206935e37 Will give a few tests with D code later.The following code generates a warning when using GCC analyzer, but I don't think the warning is valid. ``` struct Guard { ~this() {} } Guard lock() { return Guard(); } void bar() { auto foo = lock(); } ``` Compiled with GCC version 13.1:I'm at the GNU Cauldron, and David has just said "don't use -fanalyzer on C++ in GCC 13, you will get rubbish out of it". This would also extend to all other languages that aren't C too. The good news is that things are going to be improved in GCC 14.
Apr 29