[cfe-commits] r136927 - in /cfe/trunk: include/clang/Basic/IdentifierTable.h include/clang/Sema/Sema.h lib/Sema/SemaDeclObjC.cpp test/SemaObjC/class-protocol-method-match.m test/SemaObjC/qualified-protocol-method-conflicts.m

NAKAMURA Takumi geek4civic at gmail.com
Thu Aug 4 20:39:30 PDT 2011


2011/8/5 Fariborz Jahanian <fjahanian at apple.com>:
> Author: fjahanian
> Date: Thu Aug  4 16:28:44 2011
> New Revision: 136927
>
> URL: http://llvm.org/viewvc/llvm-project?rev=136927&view=rev
> Log:
> objective-c: diagnose protocol inconsistencies in following
> situation. When a class explicitly or implicitly (through inheritance)
> "conformsTo" two protocols which conflict (have methods which conflict).
> This is 2nd part of // rdar://6191214.
>
> Added:
>    cfe/trunk/test/SemaObjC/qualified-protocol-method-conflicts.m
> Modified:
>    cfe/trunk/include/clang/Basic/IdentifierTable.h
>    cfe/trunk/include/clang/Sema/Sema.h
>    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
>    cfe/trunk/test/SemaObjC/class-protocol-method-match.m

Too weird, I have seen warnings in different order with
class-protocol-method-match.m on msvc10 and mingw32.
It is not affected by -triple.

The log attached. (w/o -verify)

...Takumi
-------------- next part --------------
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:12:23: warning: conflicting parameter types in declaration of 'setX:': 'int' vs 'float'
-(void) setX: (float) arg0; // expected-note 2 {{previous definition is here}} \
               ~~~~~  ^
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:5:21: note: previous definition is here
-(void) setX: (int) arg0; // expected-warning 2 {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}} \
               ~~~  ^
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:14:1: warning: conflicting return type in declaration of 'C': 'int' vs 'float'
+(float) C; // expected-warning {{conflicting return type in declaration of 'C': 'int' vs 'float'}} \
^ ~~~~~
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:7:1: note: previous definition is here
+(int) C; // expected-warning 2 {{conflicting return type in declaration of 'C': 'float' vs 'int'}} \
^ ~~~
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:18:1: note: class is declared here
@interface A <Xint, Xfloat> // expected-note {{class is declared here}}
^
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:5:21: warning: conflicting parameter types in declaration of 'setX:': 'float' vs 'int'
-(void) setX: (int) arg0; // expected-warning 2 {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}} \
               ~~~  ^
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:12:23: note: previous definition is here
-(void) setX: (float) arg0; // expected-note 2 {{previous definition is here}} \
               ~~~~~  ^
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:7:1: warning: conflicting return type in declaration of 'C': 'float' vs 'int'
+(int) C; // expected-warning 2 {{conflicting return type in declaration of 'C': 'float' vs 'int'}} \
^ ~~~
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:14:1: note: previous definition is here
+(float) C; // expected-warning {{conflicting return type in declaration of 'C': 'int' vs 'float'}} \
^ ~~~~~
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:26:1: note: class is declared here
@interface B <Xfloat, Xint> // expected-note {{class is declared here}}
^
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:12:23: warning: conflicting parameter types in declaration of 'setX:': 'int' vs 'float'
-(void) setX: (float) arg0; // expected-note 2 {{previous definition is here}} \
               ~~~~~  ^
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:5:21: note: previous definition is here
-(void) setX: (int) arg0; // expected-warning 2 {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}} \
               ~~~  ^
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:14:1: warning: conflicting return type in declaration of 'C': 'int' vs 'float'
+(float) C; // expected-warning {{conflicting return type in declaration of 'C': 'int' vs 'float'}} \
^ ~~~~~
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:7:1: note: previous definition is here
+(int) C; // expected-warning 2 {{conflicting return type in declaration of 'C': 'float' vs 'int'}} \
^ ~~~
llvm-project/llvm/tools/clang/test/SemaObjC/qualified-protocol-method-conflicts.m:37:1: note: class is declared here
@interface C<Xint_float> // expected-note {{class is declared here}}
^
6 warnings generated.


More information about the cfe-commits mailing list