[cfe-commits] r41443 - in /cfe/trunk: Sema/SemaType.cpp clang.xcodeproj/project.pbxproj test/Sema/array-constraint.c

Chris Lattner clattner at apple.com
Mon Aug 27 17:56:36 PDT 2007


On Aug 26, 2007, at 9:03 AM, Chris Lattner wrote:

>> Fix bogus warnings (noticed by Chris) with array-constraints.c.
>
> Ahh.. I didn't notice that the argument definition had an error.  The
> type was bogus, so the error recovery code (that you removed) changed
> it to be an array of int.
>
>> Remove bogus type conversions in Sema::GetTypeForDeclarator(). This
>> commit
>> only deals with the array types (DeclaratorCheck::Array), though the
>> rest of this routine should be reviewed. Given the complexity of C
>> declarators,
>> I don't want to change the entire routine now (will discuss with
>> Chris tomorrow).
>
> Unfortunately, I think the "T = Context.IntTy;"'s should stay.
> Without these, we end up building an AST that has bogus array types.
>
> Since the testcase isn't trying to test this situation, I'd suggest
> changing the function to:
>
> struct s;
> struct s* t (struct s z[]) {   // expected-error {{array has
> incomplete element type}}
>    return 0;
> }

To close the loop, steve and I discussed this and came up with a  
devious plan.  :)

-Chris



More information about the cfe-commits mailing list