Programming languages are continuously evolving as the experiences are accumulated, developers face new problems and other requirements such as increasing support for multi-threading is emerging. These changes are reflected in new language standards and compiler versions. Although these changes are carefully planned to keep reverse compatibility with previous versions to keep the syntax and the semantics of earlier written code, sometimes languages break this rule. In case of silent semantic changes, when the earlier written code is recompiled with the new version, this is especially harmful. The new C++11 standard introduced major changes in the core language. This changes are widely believed to be reverse compatible, i.e. a simple recompilation of earlier written code will keep the old semantics. Recently we found examples that the backward compatibility between language versions is broken. The previously written code compiled with a new C++ compiler may change the program behaviour without any compiler diagnostic message. In a large code base such issues are very hard to catch by manual inspection, therefore some automatic tool support is required for this purpose. In this paper we propose a tool support to detect such backward incompatibilities in C++. The basic idea is to parse the source code using different standards, and then compare the abstract syntax trees. We implemented a proof of concept prototype tool to demonstrate our idea based on the LLVM/Clang compiler infrastructure.
[1]
Todd L. Veldhuizen,et al.
Expression templates
,
1996
.
[2]
Norbert Pataki,et al.
Clang matchers for verified usage of the C++ Standard Template Library
,
2015
.
[3]
Scott Meyers,et al.
Effective modern C++: 42 specific ways to improve your use of C++11 and C++14
,
2014
.
[4]
Norbert Pataki,et al.
Concurrent object construction in modern object-oriented programming languages
,
2015
.
[5]
Andrei Alexandrescu,et al.
Modern C++ design: generic programming and design patterns applied
,
2001
.
[6]
Bjarne Stroustrup,et al.
C++ Programming Language
,
1986,
IEEE Softw..
[7]
Bjarne Stroustrup.
The Design of C++0x
,
2009
.
[8]
David Abrahams,et al.
C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond (C++ In-Depth Series)
,
2004
.
[9]
Krzysztof Czarnecki,et al.
Generative programming - methods, tools and applications
,
2000
.
[10]
Todd L. Veldhuizen,et al.
Using C++ template metaprograms
,
1996
.