This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/16502] inappropriate -Wunreachable-code warning from generic code
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jul 2004 22:33:27 -0000
- Subject: [Bug middle-end/16502] inappropriate -Wunreachable-code warning from generic code
- References: <20040712210704.16502.sebor@roguewave.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From sebor at roguewave dot com 2004-07-12 22:33 -------
I understand that no exception can occur in foo<int>, but there are an infinite
number of such instantiations, just as there are an infinite number of those
where it can occur. The complaint I have against -Wunreachable-code is that it
diagnoses perfectly valid generic code that neither the user nor the author
may be able to "fix" so as to silence the warning. There is no way for the
author of foo to know whether T's ctor can or cannot throw, so he or she
cannot prevent the warning in general. And, given a sufficiently complex
implementation of foo, there is nothing the user of foo may be able to do,
either. The only recourse may be to turn off the warning, making it useless.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16502