[PATCH] D43871: [modules] No longer include stdlib.h from mm_malloc.h.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 11 02:25:07 PDT 2018


rsmith added inline comments.


================
Comment at: lib/Sema/SemaExceptionSpec.cpp:312
+        OldProto->getReturnType(), OldProto->getParamTypes(),
+        OldProto->getExtProtoInfo().withExceptionSpec(EST_DynamicNone)));
+    return false;
----------------
Updating the old function's type here can potentially violate our AST invariants, especially in C++17 where it will change the canonical type of the function. You would need to at least notify AST mutation listeners, and iterate over all previous declarations rather than only updating one of them. (You're also throwing away things like calling conventions here.)

`Sema::UpdateExceptionSpec` handles these details for you.


https://reviews.llvm.org/D43871





More information about the cfe-commits mailing list