The skeletal mesh value is actually stored in USkinnedMeshComponent, although not specifically declared as such it is public as the GENERATED_UCLASS_BODY() adds a public declaration in it’s macro magic - the newer version of this macro GENERATED_BODY() does not do this.
class ENGINE_API USkinnedMeshComponent : public UMeshComponent
{
GENERATED_UCLASS_BODY()
/** The skeletal mesh used by this component. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Mesh")
class USkeletalMesh* SkeletalMesh;
I was able to compile this code fine
USkeletalMeshComponent* Comp = nullptr;
check(Comp->SkeletalMesh);