My grandparents have a two bedroom, two bathroom house in El Dorado County that was built in ~1974. One day I noticed something peculiar: while the two bathrooms were connected by a sliding door, you had to go through a bedroom to get to a bathroom.
Years later (around 2010) I was telling a friend about the aforementioned bedroom bathroom linkage and they said that's not allowed in today's building code so you could not get a permit to build a new house with that type of design. The person who told me this was not a contractor or anything related (and neither am I) so I never knew if that was/is actually true.
I just spent some time searching for this information out of curiosity and while it may exist on a page somewhere, I couldn't figure what to tell google to get me there.
I'm interested if anyone knows the correct answer here but I'm also wondering why such a requirement/restriction was added to the building code. And does the same rule(s) apply for a remodel, ie. could you change whatever design you currently have to one where you could only go through a bedroom to get to a bathroom? Not that you'd necessarily want to do that, but since we're on the topic... (~: