r203277 - Replace OwningPtr::isValid() with conversion to bool.
Ahmed Charles
acharles at outlook.com
Sat Mar 8 23:29:52 PST 2014
----------------------------------------
> Date: Sat, 8 Mar 2014 10:38:51 +0100
> From: joerg at britannica.bec.de
> To: cfe-commits at cs.uiuc.edu
> Subject: Re: r203277 - Replace OwningPtr::isValid() with conversion to bool.
>
> On Fri, Mar 07, 2014 at 07:51:07PM -0000, Ahmed Charles wrote:
>> Modified: cfe/trunk/include/clang/Frontend/ASTUnit.h
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ASTUnit.h?rev=203277&r1=203276&r2=203277&view=diff
>> ==============================================================================
>> --- cfe/trunk/include/clang/Frontend/ASTUnit.h (original)
>> +++ cfe/trunk/include/clang/Frontend/ASTUnit.h Fri Mar 7 13:51:06 2014
>> @@ -500,7 +500,7 @@ public:
>> void setASTContext(ASTContext *ctx) { Ctx = ctx; }
>> void setPreprocessor(Preprocessor *pp);
>>
>> - bool hasSema() const { return TheSema.isValid(); }
>> + bool hasSema() const { return (bool)TheSema; }
>> Sema &getSema() const {
>> assert(TheSema && "ASTUnit does not have a Sema object!");
>> return *TheSema;
>>
>
> Is the old-style cast really the preferred form for LLVM?
I asked about this on IRC and so it would seem.
More information about the cfe-commits
mailing list