This happened to Jeff Samardzija for the 2014 MLB All-Star Game(1), though he was not selected as a starter(2).
He was traded from the Cubs (an NL team) to the A's (an AL team) just before the all-star rosters were announced. Samardzija was selected as a NL all-star as a member of the Cubs.
Does he ... play for the AL?
What happens in this situation, in terms of him and his All Star Status?
The league switch rendered him ineligible to pitch for the All-Star Game.
The MLB addresses the scenario in greater detail here:
What if a selected player gets traded to a team in the opposite league before the All-Star Game?
This happened to Jeff Samardzija in 2014, when the Cubs dealt him to the A's. In such a scenario, the player is deemed ineligible to participate in the game but is still recognized as an All-Star for the original league. In Samardzija's case, he wore a generic NL jersey and All-Star Game cap for the pregame player introductions.
In other words, he's still an NL all-star, but isn't able to play in the All-Star Game.
Does [he] still start for the NL? Does he start for the AL?
If he was selected to start, his ineligibility alone would render him unable to start for either team.