This patch extracts the eof/stop token pattern used in late-parsing to a re-usable RAII class. This simplifies a lot of the late-parsing code.
A few related bugs were fixed in the process:
- Late-parsing a method with default arguments but without an exception specification would result in an invalid union access. It was mostly harmless but it's technically undefined behaviour.
- When an inherited late-parsed parameter is encountered, the associated declaration is force-casted to FunctionDecl. This caused a crash when the declaration is a template.