How to Build Your First C++ Automated Refactoring Tool - Kristen Shaker - CppCon 2023

Build your first C++ automated refactoring tool using Clang query, Clang-tidy checks, and the Clang tools project, and join the ranks of hundreds of existing checks.

Key takeaways
  • Identify the pieces of code that need to be updated
  • Use Clang query to match specific AST nodes
  • Write a Clang-tidy check to identify the code to be updated
  • Use the Clang tools project to build and test the check
  • Join the existing ranks of hundreds of Clang-tidy checks
  • Use Clang query to build more matchers
  • Identify the safe and trivially destructible type
  • Refactor code to consistent style decisions
  • Fix code by suggesting name constants
  • Stop delaying language migrations and updates
  • Use Clang-tidy to automate refactoring
  • Leverage Clang libraries to scale expert knowledge
  • Use compiler explore to verify Clang-tidy checks