[Bug c++/126508] Incorrect caching of constexpr functions which rethrow

hanicka at hanicka dot net via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126508

Hana Dusíková <hanicka at hanicka dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hanicka at hanicka dot net

--- Comment #1 from Hana Dusíková <hanicka at hanicka dot net> ---
I think you are correct, the mechanism can't be only about caching when:

- if you see a `throw` keyword without any argument outside of sub-AST of a
catch-statement then the function call can't be cached
- or if you call such marked function from outside of a catch statement (to
handle cases where the throw; is hidden multiple layers deep, but still outside
of any `catch` statement along the way)

but also about not using the cache when exception is around and rather evaluate
function again, you could loose some performance, but exceptions should be
exceptional anyway.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.