Need help to figure out syntax error code

when is only supported inside a process when the VHDL standard is set to 2008 or later.

In your code example, there is no need for a process and the assignment to D can be done without the process.