The lawful heir (assuming the Spanish still haven't paid the dowry) is the Queen of France.
Note that Margaret Theresa (Philip's younger daughter) is betrothed, but not yet married to her uncle; that could provide a compromise solution for parties who want neither a Franco-Spanish union nor an Austro-Spanish one, if they can agree on an alternative husband. If the dowry has been paid, she inherits (although the French might still challenge it, if the only alternative is a recreation of the empire of Charles V).
On the other hand, all the potential combatants are somewhat distracted (England and the Netherlands are embroiled in conflict, France and Spain have only finally made peace a few years prior, the Austrians have just fought a war against the Ottomans and have to be wary of further threats). That's ignoring butterflies, of course, but similar conflicts seem likely.