C++ Source Code Rejuvenation for an Improved Exception Specification
Endre Fülöp, Attila Gyén, Norbert Pataki · 2022
Exception handling is a beneficial language construct in modern programming languages. However, C++'s type system does not really conform to these elements. As a con-sequence, developers have to pay attention to avoid mistakes because of the missing compiler support. Moreover, C++11provides an approach in which exceptions appear in the function's signature in an inverse manner compared to the earlier standards. Static analysis is an approach in which we reason about a program based on the source with no execution of the analyzed code. It can be used for many purposes, for instance, finding bugs, refactoring the code or measure code complexity. In this paper, we analyze how the older style exception speci-fications can be rejuvenated for the modern idioms. Explicitly marking the functions as having a guaranteed exception-free execution is the primary way since C++11. We develop a static analyzer tool for providing hints for these specifications. We evaluate our method with the analysis of open sources projects.