No, I have never done this, however, one of my niece's bedrooms is in a converted attic.
While there is not doubt in my mind that your local building inspectors would have some opinions about this topic - I have a couple of comments...from a safety perspective - make sure that there are 2 ways out of the room in the attic. My niece only has the stairway to get out. There is also a window in her room - but it is a long way to the ground IMHO. My other thought about her room is I don't think it is properly vented. In the summer, as the heat rises in your house - the heat just "hangs" in her room. Attics are generally hot miserable places in the summer - her room is no exception to that.