Edit: as of 2019 you can now mark functions as BlueprintPure=false to get an execution pin onto function call nodes for functions that are marked as const in c++:
UFUNCTION(BlueprintCallabe, BlueprintPure=false)
int32 Foo() const;
Original answer:
UFunctions
marked as const
are always treated as BlueprintPure
, so marking a function as const
and BlueprintPure
is redundant, and that’s why UHT complains. There are a couple things that are debatable about this:
- Conflating
BlueprintPure
and C++'sconst
keyword is a little dubious because C++const
does not imply purity.const
functions may modify mutable members and global state. - This error could just be a warning, because it is not fatal, it is simply redundant.
Current best practice is to mark const
functions as BlueprintCallable
and be aware that they will be treated as BlueprintPure
by the compiler.