This is the first reference to a future event. Gandolf, if he were ever alive, would have been so half a score of hundreds of years before the book, The Hobbit.
It is a curious trait of wizards that they live in reverse time in comparison to normal humans; that is, they are born at a human time later than they die. Wizards are older, wiser, and more powerful in the 'beginning', as humans reckon it, and grow 'younger', and less knowing and powerful in human time.
Thus, wizards 'remember' the future and 'predict' the past. It is quite plausible that Gandolf foresees Tolkien.