Issue 75940
Summary Clang generates invalid code and leaks resource when throwing an exception after return statement
Labels clang
Assignees
Reporter CurTInq
    To be fair, all the other major compilers (gcc and msvc) also generate incorrect code according to the C++ standard, however clang also produces memory leak (destructor for returned statement was never called).
It seems like something similar being reported in #61900 but in context of coroutines, while it seems to be a more common case.

Minimal reproducible example (I literally took it from [the C++ standard](https://timsong-cpp.github.io/cppwp/n4659/except.ctor#2)): https://godbolt.org/z/Wvfz4jPW7
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to