[cfe-commits] r133773 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDeclObjC.cpp test/SemaObjC/class-proto-1.m test/SemaObjC/forward-class-1.m test/SemaObjC/undef-superclass-1.m
jahanian
fjahanian at apple.com
Fri Jun 24 08:40:05 PDT 2011
On Jun 23, 2011, at 11:26 PM, Chad Rosier wrote:
> Fariborz,
> I applied the below changes in an attempt to resolve the buildbot failures. If these aren't correct please make the necessary changes.
Looks good. I changed the diagnostic yesterday and neglected objc.dg tests. Thanks for fixing it.
- Fariborz
>
> Chad
>
> ------------------------------------------------------------------------
> r133788 | mcrosier | 2011-06-23 22:50:14 -0700 (Thu, 23 Jun 2011) | 1 line
>
> Attempt to fix regression from r133773.
> ------------------------------------------------------------------------
> Index: src/objc.dg/super-class-4.m
> ===================================================================
> --- src/objc.dg/super-class-4.m (revision 133787)
> +++ src/objc.dg/super-class-4.m (revision 133788)
> @@ -5,7 +5,7 @@
>
> #include <objc/Object.h>
>
> - at class MyWpModule;
> + at class MyWpModule; /* { dg-error "forward class is declared here" } */
>
> @compatibility_alias MyObject Object;
> @compatibility_alias FictitiousModule MyWpModule;
> @@ -18,11 +18,11 @@
> - (id) meth2;
> @end
>
> - at interface FunnyModule: FictitiousModule <Img> /* { dg-error ".MyWpModule., superclass of .FunnyModule." } */
> + at interface FunnyModule: FictitiousModule <Img> /* { dg-error "attempting to use the forward class 'MyWpModule' as superclass of 'FunnyModule'" } */
> - (id) meth2;
> @end
>
> - at interface MyProjWpModule : MyWpModule <MySelTarget, Img> /* { dg-error ".MyWpModule., superclass of .MyProjWpModule." } */ {
> + at interface MyProjWpModule : MyWpModule <MySelTarget, Img> /* { dg-error "attempting to use the forward class 'MyWpModule' as superclass of 'MyProjWpModule'" } */ {
> id i1, i2;
> }
> - (id) meth1;
>
>
> On Jun 23, 2011, at 7:10 PM, Chad Rosier wrote:
>
>> Fariborz,
>> One of our internal builds is failing due to an error in the gccTestSuite (see below for errors). Would you mind checking on this?
>>
>> Regards,
>> Chad
>>
>> Test Run By mcrosier on Thu Jun 23 19:03:40 2011
>> Native configuration is i386-apple-darwin10
>>
>> === objc tests ===
>>
>> Schedule of variations:
>> unix
>>
>> Running target unix
>> Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
>> Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
>> Using /Users/mcrosier/clang-gcc-4_2-testsuite/src/config/default.exp as tool-and-target-specific interface file.
>> Running /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/dg.exp ...
>> set_ld_library_path_env_vars: ld_library_path=.:
>> Executing on host: /Users/mcrosier/llvm-clean/install/bin/clang /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m -S -o super-class-4.s (timeout = 300)
>> spawn /Users/mcrosier/llvm-clean/install/bin/clang /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m -S -o super-class-4.s
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:21:25: error: attempting to use the forward class 'MyWpModule' as superclass of 'FunnyModule'
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:8:1: note: forward class is declared here
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:25:29: error: attempting to use the forward class 'MyWpModule' as superclass of 'MyProjWpModule'
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:8:1: note: forward class is declared here
>> compiler exited with status 1
>> output is:
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:21:25: error: attempting to use the forward class 'MyWpModule' as superclass of 'FunnyModule'
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:8:1: note: forward class is declared here
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:25:29: error: attempting to use the forward class 'MyWpModule' as superclass of 'MyProjWpModule'
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:8:1: note: forward class is declared here
>>
>> FAIL: objc.dg/super-class-4.m (test for errors, line 21)
>> FAIL: objc.dg/super-class-4.m (test for errors, line 25)
>> FAIL: objc.dg/super-class-4.m (test for excess errors)
>> Excess errors:
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:21:25: error: attempting to use the forward class 'MyWpModule' as superclass of 'FunnyModule'
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:8:1: note: forward class is declared here
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:25:29: error: attempting to use the forward class 'MyWpModule' as superclass of 'MyProjWpModule'
>> /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/super-class-4.m:8:1: note: forward class is declared here
>>
>> testcase /Users/mcrosier/clang-gcc-4_2-testsuite/src/objc.dg/dg.exp completed in 0 seconds
>>
>> === objc Summary ===
>>
>> # of unexpected failures 3
>> Executing on host: /Users/mcrosier/llvm-clean/install/bin/clang -v (timeout = 300)
>> spawn /Users/mcrosier/llvm-clean/install/bin/clang -v
>> clang version 3.0 (trunk 133781)
>> Target: x86_64-apple-darwin10.7.0
>> Thread model: posix
>> /Users/mcrosier/llvm-clean/install/bin/clang version 3.0 (trunk 133781)
>>
>>
>> On Jun 23, 2011, at 4:16 PM, Fariborz Jahanian wrote:
>>
>>> Author: fjahanian
>>> Date: Thu Jun 23 18:16:19 2011
>>> New Revision: 133773
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=133773&view=rev
>>> Log:
>>> When forming a cycle in objc's inheritance hierarchy,
>>> diagnose it properly and don't throw clang into an
>>> infinit loop. // rdar://9653341
>>>
>>> Modified:
>>> cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
>>> cfe/trunk/lib/Sema/SemaDeclObjC.cpp
>>> cfe/trunk/test/SemaObjC/class-proto-1.m
>>> cfe/trunk/test/SemaObjC/forward-class-1.m
>>> cfe/trunk/test/SemaObjC/undef-superclass-1.m
>>>
>>> Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=133773&r1=133772&r2=133773&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
>>> +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Jun 23 18:16:19 2011
>>> @@ -330,6 +330,8 @@
>>> "duplicate interface definition for class %0">;
>>> def err_undef_superclass : Error<
>>> "cannot find interface declaration for %0, superclass of %1">;
>>> +def err_forward_superclass : Error<
>>> + "attempting to use the forward class %0 as superclass of %1">;
>>> def err_no_nsconstant_string_class : Error<
>>> "cannot find interface declaration for %0">;
>>> def err_recursive_superclass : Error<
>>>
>>> Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=133773&r1=133772&r2=133773&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
>>> +++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Jun 23 18:16:19 2011
>>> @@ -491,10 +491,13 @@
>>> if (!SuperClassDecl)
>>> Diag(SuperLoc, diag::err_undef_superclass)
>>> << SuperName << ClassName << SourceRange(AtInterfaceLoc, ClassLoc);
>>> - else if (SuperClassDecl->isForwardDecl())
>>> - Diag(SuperLoc, diag::err_undef_superclass)
>>> + else if (SuperClassDecl->isForwardDecl()) {
>>> + Diag(SuperLoc, diag::err_forward_superclass)
>>> << SuperClassDecl->getDeclName() << ClassName
>>> << SourceRange(AtInterfaceLoc, ClassLoc);
>>> + Diag(SuperClassDecl->getLocation(), diag::note_forward_class);
>>> + SuperClassDecl = 0;
>>> + }
>>> }
>>> IDecl->setSuperClass(SuperClassDecl);
>>> IDecl->setSuperClassLoc(SuperLoc);
>>>
>>> Modified: cfe/trunk/test/SemaObjC/class-proto-1.m
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/class-proto-1.m?rev=133773&r1=133772&r2=133773&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/test/SemaObjC/class-proto-1.m (original)
>>> +++ cfe/trunk/test/SemaObjC/class-proto-1.m Thu Jun 23 18:16:19 2011
>>> @@ -23,9 +23,9 @@
>>>
>>> @interface E2 <p1,p2,p3> @end // expected-warning {{cannot find protocol definition for 'p3'}}
>>>
>>> - at class U1, U2;
>>> + at class U1, U2; // expected-note {{forward class is declared here}}
>>>
>>> - at interface E3 : U1 @end // expected-error {{cannot find interface declaration for 'U1', superclass of 'E3'}}
>>> + at interface E3 : U1 @end // expected-error {{attempting to use the forward class 'U1' as superclass of 'E3'}}
>>>
>>>
>>> @interface I3 : E3 @end
>>>
>>> Modified: cfe/trunk/test/SemaObjC/forward-class-1.m
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/forward-class-1.m?rev=133773&r1=133772&r2=133773&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/test/SemaObjC/forward-class-1.m (original)
>>> +++ cfe/trunk/test/SemaObjC/forward-class-1.m Thu Jun 23 18:16:19 2011
>>> @@ -1,9 +1,9 @@
>>> // RUN: %clang_cc1 -fsyntax-only -verify %s
>>>
>>> - at class FOO, BAR;
>>> + at class FOO, BAR; // expected-note {{forward class is declared here}}
>>> @class FOO, BAR;
>>>
>>> - at interface INTF : FOO // expected-error {{cannot find interface declaration for 'FOO', superclass of 'INTF'}}
>>> + at interface INTF : FOO // expected-error {{attempting to use the forward class 'FOO' as superclass of 'INTF'}}
>>> @end
>>>
>>> @interface FOO
>>> @@ -45,3 +45,14 @@
>>> @end
>>>
>>>
>>> +// rdar://9653341
>>> + at class B; // expected-note {{forward class is declared here}}
>>> + at interface A : B {} // expected-error {{attempting to use the forward class 'B' as superclass of 'A'}}
>>> + at end
>>> +
>>> + at interface B : A {}
>>> + at end
>>> +
>>> + at implementation A @end
>>> + at implementation B @end
>>> +
>>>
>>> Modified: cfe/trunk/test/SemaObjC/undef-superclass-1.m
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/undef-superclass-1.m?rev=133773&r1=133772&r2=133773&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/test/SemaObjC/undef-superclass-1.m (original)
>>> +++ cfe/trunk/test/SemaObjC/undef-superclass-1.m Thu Jun 23 18:16:19 2011
>>> @@ -1,8 +1,8 @@
>>> // RUN: %clang_cc1 -fsyntax-only -verify %s
>>>
>>> - at class SUPER, Y;
>>> + at class SUPER, Y; // expected-note 2 {{forward class is declared here}}
>>>
>>> - at interface INTF :SUPER // expected-error {{cannot find interface declaration for 'SUPER', superclass of 'INTF'}}
>>> + at interface INTF :SUPER // expected-error {{attempting to use the forward class 'SUPER' as superclass of 'INTF'}}
>>> @end
>>>
>>> @interface SUPER @end
>>> @@ -13,7 +13,7 @@
>>> @interface INTF2 : INTF1
>>> @end
>>>
>>> - at interface INTF3 : Y // expected-error {{cannot find interface declaration for 'Y', superclass of 'INTF3'}} \
>>> + at interface INTF3 : Y // expected-error {{attempting to use the forward class 'Y' as superclass of 'INTF3'}} \
>>> // expected-note{{'INTF3' declared here}}
>>> @end
>>>
>>>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list