Issue 71830
Summary clang ignores -Wat-protocol when building Objc++ code
Labels clang
Assignees
Reporter rmaz
    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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to