[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2021-06-15 Thread nyh at math dot technion.ac.il via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 Nadav Har'El changed: What|Removed |Added CC||nyh at math dot technion.ac.il ---

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2021-02-18 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #26 from Martin Liška --- > I see the pattern in libyui-3.12.2 package. and the second affected package is inkscape: https://gitlab.com/inkscape/inkscape/-/issues/2206

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2021-02-18 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #25 from Martin Liška --- (In reply to Martin Sebor from comment #24) > I see. Yes, if the types are unrelated, that would be a likely bug. I > think could and should be diagnosed by the C++ front end, by some more > targeted

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2021-02-16 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #24 from Martin Sebor --- I see. Yes, if the types are unrelated, that would be a likely bug. I think could and should be diagnosed by the C++ front end, by some more targeted warning than -Wnonnull (as requested in pr38557). But

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2021-02-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #23 from Martin Liška --- (In reply to Martin Sebor from comment #20) > Martin, does the code in the packages follow the pattern below? > > $ cat t.C && gcc -O2 -S -Wall t.C > struct A { virtual ~A (); }; > struct B { virtual ~B ();

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2021-02-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #22 from Martin Liška --- (In reply to Martin Sebor from comment #21) > Also, how many warnings for this type of code (or other) do you see? If > there are too many it might be worth revisiting the decision. I see it only in 4

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2021-02-16 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #21 from Martin Sebor --- Also, how many warnings for this type of code (or other) do you see? If there are too many it might be worth revisiting the decision.

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2021-02-16 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #20 from Martin Sebor --- Martin, does the code in the packages follow the pattern below? $ cat t.C && gcc -O2 -S -Wall t.C struct A { virtual ~A (); }; struct B { virtual ~B (); void f (); }; void f (A *p) { if (dynamic_cast(p))

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2021-02-08 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #19 from Martin Liška --- (In reply to Martin Sebor from comment #17) > Warnings for the static cast suppressed in r11-2457. > > The warning for the dynamic cast is still issued and I would suggest to use > a cast to a reference

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2020-07-31 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #18 from Martin Sebor --- (In reply to Sergei Trofimovich from comment #8) > Also, the "'this' pointer null" error wording is not very clear. Should it > be "'this' pointer is null"? Or "'this' pointer may be null"? I agree that the

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2020-07-31 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 Martin Sebor changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2020-07-31 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #16 from CVS Commits --- The master branch has been updated by Martin Sebor : https://gcc.gnu.org/g:df5cf47a978aaeb53fc2b18ff0b22eb4531a27d8 commit r11-2457-gdf5cf47a978aaeb53fc2b18ff0b22eb4531a27d8 Author: Martin Sebor Date:

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2020-07-30 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #15 from Martin Sebor --- The patch I posted two weeks ago is only now being reviewed.

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2020-07-30 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #14 from Martin Liška --- @Martin: Any progress on this bug?

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2020-07-22 Thread sbergman at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #13 from Stephan Bergmann --- FTR, with that second patch building recent LibreOffice succeeds without false positives.

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2020-07-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #12 from Martin Sebor --- Thanks for the test case. In it, the no-warning bit set on the conditional expression to avoid the warning is cleared before the expression reaches the warning code. The culprit seems to be the

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2020-07-21 Thread sbergman at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 --- Comment #11 from Stephan Bergmann --- (In reply to Martin Sebor from comment #10) > Patch for the static cast: > https://gcc.gnu.org/pipermail/gcc-patches/2020-July/550231.html LibreOffice runs into the same issue, but while the above patch

[Bug c++/96003] [11 Regression] spurious -Wnonnull calling a member on the result of static_cast

2020-07-17 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003 Martin Sebor changed: What|Removed |Added Summary|[11 Regression] Maybe a |[11 Regression] spurious