[clang] Fix __try/__finally blocks in C++ constructors.
authorEli Friedman <efriedma@quicinc.com>
Wed, 16 Nov 2022 23:13:33 +0000 (15:13 -0800)
committerEli Friedman <efriedma@quicinc.com>
Wed, 16 Nov 2022 23:13:33 +0000 (15:13 -0800)
commit0fcb26c5b6487bf9b31670122f8c931ac020bb34
tree2994994a8fa50cc3a7a3474c674d1119f9fee5cc
parent55f56cdc3329b9af059caf7fd5df01fe4e54eb14
[clang] Fix __try/__finally blocks in C++ constructors.

We were crashing trying to convert a GlobalDecl from a
CXXConstructorDecl.  Instead of trying to do that conversion, just pass
down the original GlobalDecl.

I think we could actually compute the correct constructor/destructor
kind from the context, given the way Microsoft mangling works, but it's
simpler to just pass through the correct constructor/destructor kind.

Differential Revision: https://reviews.llvm.org/D136776
clang/include/clang/AST/Mangle.h
clang/lib/AST/ItaniumMangle.cpp
clang/lib/AST/MicrosoftMangle.cpp
clang/lib/CodeGen/CGException.cpp
clang/lib/CodeGen/CodeGenFunction.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/test/CodeGenCXX/exceptions-seh.cpp