Teaching Old Compilers New Tricks: Transpiling C++17 to C++11
summary
A libclang-based tool called clang-from-the-future reads C++17 and emits equivalent C++11 source by performing libclang AST rewriting and a custom rewrite/template-specialization engine, handling digit separators, binary literals, structured bindings, constexpr-if, fold expressions, and return-type deduction. It runs as a preprocessing step, integrates by swapping CXX or adding a frontend flag, produces the same executables on older compilers (example: GCC 4.8), includes a test suite, is on GitHub, and currently covers a small, growing feature set.
AI-written summary · about
chapters (12)
- 0:00Introduction and motivation
- 7:28Why C++17 matters
- 10:40Introducing Clang-from-the-Future
- 13:52Demo: if/initializer syntax
- 17:20Demo: constexpr transformations
- 19:15Demo: structured bindings
- 23:10Demo: pack expansions
- 24:46How the tool works
- 26:56Integration with build systems
- 27:39Live test suite demo
- 29:25Use cases and benefits
- 30:28Current status and future








