This patch supports the following checks:
[5.1] 2.21.2 THREADPRIVATE Directive The threadprivate directive must appear in the declaration section of a scoping unit in which the common block or variable is declared. [5.1] 2.14.7 Declare Target Directive The directive must appear in the declaration section of a scoping unit in which the common block or variable is declared.
Does it make sense to include the particular offending Name here as well? Like in case i is the offending variable, maybe we can say so explicitly in the error. Please let me know what you think about this.