[Bug middle-end/16502] inappropriate -Wunreachable-code warning from generic code
sebor at roguewave dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 12 22:33:00 GMT 2004
------- 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
More information about the Gcc-bugs
mailing list