clang-tidy for Unreal Engine
Catch C++ bugs before you run them. Now free for up to 5 users!
Dozens of built-in checks for Unreal Engine
clang-tidy for Unreal Engine detects logical errors, performance issues and Unreal Engine specific bugs in your game code, including:
- Missing
Super::BeginDestroy()
in derivedBeginDestroy()
implementations. - Forgetting to call
DOREPLIFETIME()
on a replicated property in yourGetLifetimeReplicatedProps()
function. - Function parameters which could be const references to avoid unnecessary memory copies.
- Incorrectly using
TArray<>
APIs with references from for-range loops. - Storing shared references to online subsystem interfaces and objects beyond their expected lifetime.
- Missing
UPROPERTY()
on UObject pointer fields within aUCLASS()
, which would cause the garbage collector to not track a reference. - ... and more!
Works in every IDE
Whether you're building in Visual Studio, Rider, from the command line or on a build server, clang-tidy checks your code and emits warnings and errors as appropriate.
clang-tidy for Unreal Engine hooks into UnrealBuildTool, so there's no additional configuration. It just works, regardless of how you compile your code.
Plus it works on Unreal Engine 4.27 and all versions of Unreal Engine 5, so you can use it with the latest Unreal Engine features!
Write your own checks
With clang-tidy for Unreal Engine, you can write your own checks to detect bugs in your own game code.
Using the full power of Clang AST matchers, you can write your checks to target any C++ code you want. You can check for missing calls, incorrect usages of Unreal Engine APIs and anything else you can think of!
Refer to the documentation on how to write your own C++ checks.
check {
name = "my-custom-check",
description = [[Detects when you access the HelloWorld field on AMyActor.]],
matcher = [[
memberExpr(
hasObjectExpression( expr(
hasType( qualType(
pointsTo( cxxRecordDecl( hasName("AMyActor") ) )
) )
) ),
member(
valueDecl( hasName("HelloWorld") )
)
).bind("bad_access")
]],
message = [[do not access the HelloWorld field on AMyActor. call GetHelloWorld() instead.]],
callsite = "bad_access"
}
Up to 5 users
Free. No cost. $0.
More than 5 users
Please get in touch.
Free for up to 5 users
clang-tidy for Unreal Engine is now available at no cost:
- If you're an individual and you have 5 or fewer developers working on your project over its whole development lifetime.
- If you are a company and you have 5 or fewer employees.
- If you have an active Premium support plan with Redpoint Games.
If your team is larger than 5 people, please email [email protected] to get in touch with us. We can provide trials on request, and can tailor pricing to your budget.