Out West, it's not very common, but I've put plenty of W.H. in attics above living spaces.
They have to have a 3'' tall drip pan with two 1'' drain lines piped into a sewer line one of the drains is higher than the other as it is supposed to act as an overflow in case the first line gets fouled with debris.
And it's very common to install W.H's in ceiling spaces in commercial buildings mainly when doing tenant improvement work such as adding mop sink rooms, restrooms, break rooms and kitchens in high rises.
I know there are plenty of code variances throughout the states, but I'm fairly sure that the whole country has to stick to the "universal plumbing code"Written by IAPMO members which are Chief plumbing inspectors, pipe trades parts builders, engineers and union officials from across the country it's held in Ann Arbor, Michigan. My father was a union plumber for 60+ years and an IAPMO member for 20+ years and the chief plumbing inspector in S.F. He still teaches pipefitters and plumbing apprentices at the union hall in S.F. two nights a week at 80 yrs old. Both my older brother and me were union plumbers or fitters as well. But we are both retired thank God you wouldn't catch me dead in S.F. these days that city is the butt hole of CA. Nope, I won't go to S.F. for nothing these days what a sad excuse for a city/ crap hole of a city.