There was not a king of France until the 1328 that wasn't the previous king's son
Slight correction/expansion I'll be making there: from Robert II in 996 (his father Hugh Capet was technically elected to the throne) to Louis X in 1314, every King of France was the son of the previous one. But when Louis X died in 1316, he only left behind a pregnant wife and a four year old daughter. That's technically the first time the question of the succession arose. It eventually resulted in a Regency led by Louis X's younger brother Philippe de Poitiers until Clementia of Hungary (Louis X's widow) gave birth to John I the Posthumous. But then John I died five days after his birth.
After John I's death, the matter of the succession was disputed between Louis X's four year old daughter, Joan of Navarra, and his brother Philippe de Poitiers. Long story short, Joan was ruled out for being too young, for being a girl (thus over concerns over who her husband would be) and possibly for doubts on her legitimacy (her mother, Margaret of Burgundy was condemend for adultery in the famous Tower of Nesle scandal) though that last one weighed less than it's made out to be in the grand scheme of things. As a result of Joan's removal, Philippe de Poitiers became King Philippe V of France.
Fast forward to 1322 and Philippe V is dead too, without a surviving son. Unlike Louis X though, Philippe V's eldest daughter, Joan, was 14 years old and already wedded to Duke Eudes IV of Burgundy: so in theory, she could have clamied the throne. However, going by the precedent established in 1316, she was ruled out as a possible successor and thus the crown went to her uncle Charles, the youngest son of Philippe IV and the last surviving brother of Louis X and Philippe V, who became Charles IV.
We then come to the situation in 1328: Charles IV is dead too, without a son at the time of his death. He does leave behind a pregnant wife like Louis X, which leads to a Regency led by Philippe of Valois until she gives birth: this time however, the baby turns out to be a girl. We thus come to a situation where the Direct Capetians are dead in the male line and thus where the question of the succession needs to be taken. There were actually four major candidates considered at the time, even if only two are well-remembered:
- Philippe of Evreux, the husband of Joan of Navarra, daughter of Louis X. Also, he is the son of Louis of Evreux, the younger brother to Philippe IV and Charles of Valois.
- Philippe of Burgundy, the five-year old (at the time) son of Eudes IV of Burgundy and his wife Joan, daughter of Philippe V.
- Edward III of England, who was the son of Isabelle of France, daughter of Philippe IV and sister to both Louis X, Philippe V and Charles IV.
- Philippe of Valois, nephew of Philippe IV, regent of the Kingdom at the time and the closest heir through the male line, being the son of Charles of Valois, the eldest of Philippe IV's younger brothers.
Note that all the candidates considered are men, probably as a result of the precedents established in 1316 and 1322 where women were ruled out in favor of men. Three of them were however claiming the crown by dynastic links made through women. It was ultimately considered that the 1316 and 1322 precedent also meant that only descendants through the male line could ascend the throne: that's why Philippe of Valois became Philippe VI in the end.
Note that these were all based on precedents, and not on a codified succession. The actual codification came at a much later time and was actually helped by the Hundred Years War. After all, when facing an English King that says he's the true King of France, the Valois needed all they could get to discredit him. The first time the term of Salic Law appears in texts regarding the succession is in 1358 and it's still rather shaky and more made out of pro-Valois propaganda than anything else. It does however pave the way to the actual codification that actually came under Charles VII, in the middle of the XVth Century. After that, the rules of succession in France were definitely settled: you could argue there was one last hiccup with Henri IV's ascension in 1589 and his conversion in 1594, but that's more a rule linked to religion than to actual lineage.
This is a very good example of Louis XIV doing incredible damage down the line. True, the Régent had some weird ideas concerning polysynodie but he dropped them after a while, and the legacy of having to giving power to the Parlement to quash the will of a king resonated when it came time for another young king, Louis XVI, to assert his power or not. And when you consider the impact of the Fronde on Louis XIV, you have to wonder what made him think than creating a new generation of légitimés like all the Vendômes and other Beauforts would bring to the country.
To be fair, Louis XIV established his will in the final months of his life. He had kinda took a huge moral blow as he had seen most of his family wiped out by smallpox, leaving only a five year old great grandson as his successor, as well as another grandson who was now King of Spain and whose rights to the French throne could be easily contested. You could interpret the decision to add two of his bastards in the line of succession as a will to ensure his children/descendants would keep the throne.
Another argument has also been made that Mme de Maintenon played a huge role in the redaction of the will as it became to be known. Considering how she treasured the Duke of Vendôme and despied the Orléans, the content of the will becomes less surprising.
I will end with pointing out that while the Regent giving back the ability of Parliaments to quash the will of the King (the famous
droit de remontrances) resonated as a move to reduce royal authority, it's also kinda what killed the monarchy in the end. When you look at their attitude under Louis XV and Louis XVI, you realise that Parliaments were actually incredibly rigid and conservative institutions, blocking many of the reforms that would have been needed at the time... especially in the fiscal department. But obviously, as it's something that happened after his death, that's not really something Louis XIV could have known in advance.