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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D43871: [... Bruno Cardoso Lopes via Phabricator via cfe-commits
    • [PATCH] D438... Chandler Carruth via Phabricator via cfe-commits
    • [PATCH] D438... Raphael Isemann via Phabricator via cfe-commits
    • [PATCH] D438... Vassil Vassilev via Phabricator via cfe-commits
    • [PATCH] D438... Richard Smith - zygoloid via Phabricator via cfe-commits

Reply via email to