[Bug c++/85043] -Wuseless-cast false positive for temporary objects; add separate -Wcast-to-the-same-type to cover that case instead

2022-10-24 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 --- Comment #18 from Marek Polacek --- The casts that are still warned about should really be useless so I don't plan to add another warning.

[Bug c++/85043] -Wuseless-cast false positive for temporary objects; add separate -Wcast-to-the-same-type to cover that case instead

2022-10-23 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 --- Comment #17 from Eric Gallager --- (In reply to Marek Polacek from comment #16) > Should be fixed now. It seems the fix just silenced the -Wuseless-cast false positive without also adding the separate -Wcast-to-the-same-type flag to cover th

[Bug c++/85043] -Wuseless-cast false positive for temporary objects; add separate -Wcast-to-the-same-type to cover that case instead

2022-10-19 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Patrick Palka changed: What|Removed |Added Target Milestone|--- |13.0 CC|

[Bug c++/85043] -Wuseless-cast false positive for temporary objects; add separate -Wcast-to-the-same-type to cover that case instead

2022-10-19 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Marek Polacek changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c++/85043] -Wuseless-cast false positive for temporary objects; add separate -Wcast-to-the-same-type to cover that case instead

2022-10-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 --- Comment #15 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:b3c98d6a59a6dcd5b0b52bd5676b586ef4fe785f commit r13-3388-gb3c98d6a59a6dcd5b0b52bd5676b586ef4fe785f Author: Marek Polacek Date: Tu

[Bug c++/85043] -Wuseless-cast false positive for temporary objects; add separate -Wcast-to-the-same-type to cover that case instead

2022-10-18 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 --- Comment #14 from Marek Polacek --- I've encountered this bug with: struct S { }; void g(S&&); void f (S&& arg) { g(S(arg)); // warning: useless cast to type 'struct S' } which doesn't compile without the cast, because then "arg" is an lv

[Bug c++/85043] -Wuseless-cast false positive for temporary objects; add separate -Wcast-to-the-same-type to cover that case instead

2022-10-18 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Marek Polacek changed: What|Removed |Added CC||prokofjev.d at gmail dot com --- Comment

[Bug c++/85043] -Wuseless-cast false positive for temporary objects; add separate -Wcast-to-the-same-type to cover that case instead

2022-10-18 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Marek Polacek changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned a

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-09-23 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org --- Comment

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-27 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 --- Comment #11 from Paolo Carlini --- That approach would be definitely Ok with me, Eric.

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-27 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 --- Comment #10 from Eric Gallager --- (In reply to Paolo Carlini from comment #2) > Thanks. I'm seriously wondering if this is also a problem with the name of > the warning, because, I suppose, the same warning named > -Wcast-to-the-same-type wo

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-27 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Paolo Carlini changed: What|Removed |Added CC|paolo.carlini at oracle dot com| --- Comment #9 from Paolo Carlin

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-27 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment #8

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-27 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Paolo Carlini changed: What|Removed |Added CC|paolo at gcc dot gnu.org | --- Comment #7 from Paolo Carlin

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-23 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 --- Comment #6 from Jonathan Wakely --- (In reply to Jakub Jelinek from comment #4) > Why would user-provided copy ctor matter? In this testcase there is no > user-provided copy ctor, what matters is that the static cast is handled > through > p

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-23 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Paolo Carlini changed: What|Removed |Added CC||paolo.carlini at oracle dot com --- Comm

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-23 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 --- Comment #4 from Jakub Jelinek --- (In reply to Jonathan Wakely from comment #3) > Maybe we could suppress the warning for explicit type conversions using > functional notation, i.e. A(a), when the copy constructor is user-provided. > > It's

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-23 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 --- Comment #3 from Jonathan Wakely --- Maybe we could suppress the warning for explicit type conversions using functional notation, i.e. A(a), when the copy constructor is user-provided. It's not a perfect heuristic. It would still warn for (A)

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-22 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Paolo Carlini changed: What|Removed |Added CC||paolo.carlini at oracle dot com --- Comm

[Bug c++/85043] -Wuseless-cast false positive for temporary objects

2018-03-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|