I have lived in too many apartments that had an in-kitchen very small closet/cabinet that was supposed to be considered the pantry to not consider the pantry part of the kitchen, or at least an accessory of the kitchen. But then, while the space inside the confines of a bedroom that is taken by a closet is not a usable sleeping-related part of a bedroom, I consider it part of the bedroom too, if it's only accessible from inside the bedroom.
no subject