This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/16502] inappropriate -Wunreachable-code warning from generic code


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]