[cfe-commits] r44376 - in /cfe/trunk: AST/Expr.cpp include/clang/AST/Expr.h test/Sema/init.c

Chris Lattner sabre at nondot.org
Tue Nov 27 20:30:16 PST 2007


On Nov 27, 2007, at 3:00 PM, Nuno Lopes wrote:

>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- cfe/trunk/AST/Expr.cpp (original)
>> +++ cfe/trunk/AST/Expr.cpp Tue Nov 27 15:35:27 2007
>> @@ -373,6 +380,8 @@
>>   case MemberExprClass:
>>     const MemberExpr *M = cast<MemberExpr>(this);
>>     return !M->isArrow() && M->getBase()->hasStaticStorage();
>> +  case ArraySubscriptExprClass:
>> +    return cast<ArraySubscriptExpr>(this)->getBase()- 
>> >hasStaticStorage();
>>   }
>> }
>>
>
>
> this one breaks the build for me with gcc 4.1.2:
> llvm[1]: Compiling Expr.cpp for Debug build
> Expr.cpp: In member function 'bool clang::Expr::hasStaticStorage()  
> const':
> Expr.cpp:383: error: jump to case label
> Expr.cpp:381: error:   crosses initialization of 'const  
> clang::MemberExpr* M'
>
> I suggest moving the 'case ArraySubscriptExprClass' above the 'case
> MemberExprClass'.

Fixed, sorry.

-Chris



More information about the cfe-commits mailing list