syntax: allow macros to expand to items with attributes.

Fixes #4471.