[Bug c++/32525] Request for new warning: useless dynamic_casts

2010-02-20 Thread manu at gcc dot gnu dot org
--- Comment #8 from manu at gcc dot gnu dot org 2010-02-21 00:17 --- (In reply to comment #5) I filed the bug because it seems like this would be at least marginally useful, and this way people can find it / read the discussion / whatever. Even if the end result is WONTFIX, that at

Re: [Bug c++/32525] Request for new warning: useless dynamic_casts

2007-07-14 Thread Gabriel Dos Reis
lloyd at randombit dot net [EMAIL PROTECTED] writes: | I think that's a good definition. My impression is that dynamic_cast is fairly | expensive, well, I don't think GCC should be getting into the business of warning about expensive operations. -- Gaby

[Bug c++/32525] Request for new warning: useless dynamic_casts

2007-07-14 Thread gdr at cs dot tamu dot edu
--- Comment #6 from gdr at cs dot tamu dot edu 2007-07-14 13:02 --- Subject: Re: Request for new warning: useless dynamic_casts lloyd at randombit dot net [EMAIL PROTECTED] writes: | I think that's a good definition. My impression is that dynamic_cast is fairly | expensive, well, I

[Bug c++/32525] Request for new warning: useless dynamic_casts

2007-07-14 Thread sebor at roguewave dot com
--- Comment #7 from sebor at roguewave dot com 2007-07-15 00:03 --- In cases when the compiler can figure out that the cast is unnecessary it would be even better if it would optimize it away than to complain to the user about not being able to do it. --

[Bug c++/32525] Request for new warning: useless dynamic_casts

2007-06-27 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2007-06-27 18:14 --- However it would be nice if the programmer was notified about them, since even if there is no run-time cost, there is a source-level increase in complexity which can easily be avoided (and there may well be

[Bug c++/32525] Request for new warning: useless dynamic_casts

2007-06-27 Thread bangerth at dealii dot org
--- Comment #2 from bangerth at dealii dot org 2007-06-27 18:53 --- This strikes me as one of the things that hardly anybody would ever find useful. I mean, yes it happens, but no, it doesn't hurt, and I haven't seen such code written in the first place ever. Warnings are for cases

[Bug c++/32525] Request for new warning: useless dynamic_casts

2007-06-27 Thread lloyd at randombit dot net
--- Comment #3 from lloyd at randombit dot net 2007-06-27 19:06 --- I haven't seen such code written in the first place ever. Neither had I, until I found out it is endemic in a large project at work. I'd just as soon write a script to find these cases, but figuring out what the

[Bug c++/32525] Request for new warning: useless dynamic_casts

2007-06-27 Thread bangerth at dealii dot org
--- Comment #4 from bangerth at dealii dot org 2007-06-27 19:17 --- (In reply to comment #3) I think that's a good definition. My impression is that dynamic_cast is fairly expensive, But only if the compiler can't know the actual type of an object (which is exactly the case that you

[Bug c++/32525] Request for new warning: useless dynamic_casts

2007-06-27 Thread lloyd at randombit dot net
--- Comment #5 from lloyd at randombit dot net 2007-06-27 19:33 --- I filed the bug because it seems like this would be at least marginally useful, and this way people can find it / read the discussion / whatever. Even if the end result is WONTFIX, that at least lets anyone in the