Fail gracefully instead. Prevent further misuse by enforcing the factory builder instead of the constructor.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This is quite a bit of extra boilerplate, but it results in a more transparent error handling. However, the documentation would need to be changed (clang/docs/LibASTMatchersTutorial.rst). And what about other tools (e.g. clang-tools-extra/clang-include-fixer/tool/ClangIncludeFixer.cpp, clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp, etc.)?