The Code does not refer to a “Bedroom”. Rather it’s a “Sleeping Unit”.
A Sleeping Unit REQUIRES an egress window (or door) but must be to the exterior. The window is used by the occupants for escape AND it’s used by emergency personnel to enter the structure and rescue people, animals, etc.
In addition, don’t forget 1) the space must be a certain size, 2) there is a minimum head height required, 3) there’s a smoke detector required, 4) if there’s steps leading to it, they must be a certain size AND have a handrail placed at a certain height on one side of the stairway, if it’s over 3 steps.
Edit: If the op is wondering if the space can be a sleeping unit without an egress window, because it use to be a sleeping space, the answer is: no. The code says: “Alterations to any structure shall comply with the current code requirements for new construction.” (See ICC Chapter 34)
EDIT: “Grandfathered” construction is one of the most misunderstood phenomena in the code.
First, you need to know that the term “Grandfathered” is not in the code. What everyone is thing of is “Existing Buildings and Structures”. (See ICC Appendix “J”, Section AJ 101 through AJ601)
Second, you need to know that the Building Official can require anything...including spreading peanut butter on all the walls. There is also an “Appeal Process” and he’d probably loose that one. However, just because something existed for many years, it doesn’t mean the Building Official can’t require it to be “fixed” if he deems it dangerous, hazardous, etc....including structural, exiting, plumbing, electrical, etc. AND if that item does not meet the current code, they’d probably win that “non-compliance notice”.
Third, there are three items that need to be “fixed” regardless if the Building Official sees it or not. As a building owner you are required to 1) install smoke detectors that comply with the current code, 2) non-tempered glass (including plate glass, wire glass, etc.) needs to be replaced with tempered glass where required by the current code, and 3) egress windows that comply with the current code.
So, to answer the OP’s question, the bedroom will comply if it has a smoke detector, egress window, complying tempered glass, and does not have something the Building Official thinks needs to be fixed.