There were a few issues previously with the target
attribute diagnostics implementation that lead to the
attribute being added to the AST despite having an error
in it.
This patch changes that, and adds a test to ensure it
does not get added to the AST.
Can you manually quote 'target' in the diagnostic? I know it wasn't there before, but we try to stick quotes around syntactic constructs.