We don't need a side table in ASTContext to hold CXXDefaultArgExprs. The
important part of building the CXXDefaultArgExprs was to ODR use the
default argument expressions, not to make AST nodes. Refactor the code
to only check the default argument, and remove the side table in
ASTContext which wasn't being serialized.
Fixes PR31121
It would seem a lot more reasonable to actually form an expression to perform the copy of the exception object, and attach that to the ThrowExpr somehow.
Most of this work should not be MS-ABI-specific -- we're required to check that a thrown exception object can be copied (from a non-cv-qualified lvalue) regardless of ABI mode (see [except.throw]/5). In fact, for AST consumers other than IR generation, we could argue that /none/ of this should be MS-ABI specific; those consumers might want to find the implied call to the exception type's copy constructor within the guts of the throw expression, even if we never happen to use it when targeting Itanium.
So... how about we just unconditionally store a copy expression on the ThrowExpr? (With an OpaqueValueExpr representing the exception itself.)