6 Statements [stmt.stmt]

6.4 Selection statements [stmt.select]

6.4.1 The if statement [stmt.if]

If the condition ([stmt.select]) yields true the first substatement is executed. If the else part of the selection statement is present and the condition yields false, the second substatement is executed. If the first substatement is reached via a label, the condition is not evaluated and the second substatement is not executed. In the second form of if statement (the one including else), if the first substatement is also an if statement then that inner if statement shall contain an else part.88

In other words, the else is associated with the nearest un-elsed if.