On Wed, May 7, 2014 at 2:07 PM, Florian Weimer <fwei...@redhat.com> wrote: > On 05/07/2014 02:04 PM, Richard Biener wrote: > >> Depends on what "trivially" unreachable is. Yes, >> >> int main() >> { >> if (0) >> foo (); >> } >> >> will already be optimized. But I doubt you want to warn for that >> given C++ and templates which often have this kind of specializations. > > > Precisely. But optimizing this: > > > int main() > { > if (0) > foo (); > else > throw std::logic_error ("error"); > bar (); > } > > to: > > int main() > { > throw std::logic_error ("error"); > bar (); > } > > would cause the code to issue such unwanted warnings. That's why I need > access to these trivial if statements.
I don't think it would. bar () would be gone already as throw doesn't return. Richard. > > -- > Florian Weimer / Red Hat Product Security Team