> The problem is not the conditional compilation. That works just fine.
The problem here is that the attribute annotation is on a declare statement. AFAIK, that is not legal; we do not collect the corresponding context from the attributes pass.
So, from my point of view the problem here is that there was an inspection result for the missing attribute in the first place instead of one for an illegal annotation.