snippetbashTip
clang-check — Check basic errors and work with Clang's Abstract Syntax Tree (AST). Part of Clang's LibTooling and
Viewed 0 times
commandclang-checkerrorsandclicheckbasicwork
Problem
How to use the
clang-check command: Check basic errors and work with Clang's Abstract Syntax Tree (AST). Part of Clang's LibTooling and is useful for debugging and analyzing C/C++ code. More information: <https://manned.org/clang-check>.Solution
clang-check — Check basic errors and work with Clang's Abstract Syntax Tree (AST). Part of Clang's LibTooling and is useful for debugging and analyzing C/C++ code. More information: <https://manned.org/clang-check>.Run default checks on a source file:
clang-check {{path/to/file.cpp}} --Dump the Abstract Syntax Tree for debugging:
clang-check {{path/to/file.cpp}} -ast-dump --Filter AST by Name:
clang-check {{path/to/file.cpp}} -ast-dump -ast-dump-filter FunctionNamePretty-Print AST:
clang-check {{path/to/file.cpp}} -ast-print --Code Snippets
Run default checks on a source file
clang-check {{path/to/file.cpp}} --Dump the Abstract Syntax Tree for debugging
clang-check {{path/to/file.cpp}} -ast-dump --Filter AST by Name
clang-check {{path/to/file.cpp}} -ast-dump -ast-dump-filter FunctionNamePretty-Print AST
clang-check {{path/to/file.cpp}} -ast-print --Context
tldr-pages: common/clang-check
Revisions (0)
No revisions yet.