<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/71830>71830</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang ignores -Wat-protocol when building Objc++ code
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          rmaz
      </td>
    </tr>
</table>

<pre>
    When compiling the sample code:
```
@protocol Blah;

__attribute__((objc_root_class))
@interface SomeClass 
@end

@implementation SomeClass

- (void)checkProto:(Protocol *)p {}

- (void)someFunc {
        [self checkProto:@protocol(Blah)];
}

@end
```
for objc we get as expected:
```
% clang -Wat-protocol -x objective-c -c ex.m -o ex.o 
ex.m:15:19: warning: @protocol is using a forward protocol declaration of 'Blah' [-Wat-protocol]
        [self checkProto:@protocol(Blah)];
 ^
ex.m:1:11: note: 'Blah' declared here
@protocol Blah;
          ^
1 warning generated.
```
however when targeting objc++ we get no diagnostic:
```
% clang -Wat-protocol -x objective-c++ -c ex.m -o ex.o
```
I would expect the diagnostic to be emitted in both cases.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVEGvozYQ_jXDZUQEJjziA4ekr5F66ko97DEy9gBujR3Z5uW1v74yIY-X1a566EbETpjxN5-_zx4Rgh4sUQv1CerXTMxxdL71k_gn65z6u_06kkXppqs22g4YR8IgpqshlE4RVEcoXqE4wkuxPve_--LqXXTSGTwZMUJ1WgPLeLmIGL3u5kiXC7ADsIPr_pQX71y8SCNCAMbT8wDTNpLvhST8w030S8rAjyBZ9Rk8pSeCE9koonZ2W_M5LUdghzenFTAuR5J_fUmE04bY4cuDO7AjMH5FaE7QvP5oeXATnWcrl7QliusH6lMg0-NzgU0cYIdFHsahft1Eei71tMVnnXvnMSmHN8KBIoqA9H4lGUn90BpWozTCDph_FTH_sCl_T0gko36jXGIukd53E-YuzW5VO72C6ljWaeBQHfEmvNV2SD8_m64DziEdGIG98zfhFX7EFEkj_N0a1yOw5q5Bk-R6IpVE-Ql6ItS_PvNP3zSgdZEW7huJOz1SOJKn_zjOiBuztUT5kAQHsuRFJLX7rhGju9EbebylGxaFHyimVclOYCdgp4ep1qHSYrAuRC3_n60r8DfmfhfwN7y52aj1PC0Xf2OB0WFHSJOOkRRqi52LI0oRKOwy1VaKV1xk1JYvnNd1wflLNrZKUScbrsqiqppuz6Uqyr7vVF1SKUvOM92yglVlWfCyYbxmO9UIIfZ7RWVdVBX16SpMQpudMW_Tzvkh0yHM1DbloSoyIzoyYWlljC1iAGOpq_k25efdPATYF0aHGDaEqKOh9q6dHqzzFL7RcHGom7VRyaDfN4NSC8xmb9oxxmtYescZ2HnQcZy7nXQTsHOqs04JMVkB7LzQDsDOC_N_AwAA__-s2KcZ">