[cfe-commits] [PATCH] Fix name clash (Name clash causing troubles)

Dmitri Gribenko gribozavr at gmail.com
Mon Jul 2 08:22:44 PDT 2012


On Sat, Jun 30, 2012 at 11:08 AM, Jordan Rose <jordan_rose at apple.com> wrote:
> On Jun 30, 2012, at 2:31 AM, Dmitri Gribenko wrote:
>> On Sat, Jun 30, 2012 at 12:55 AM, Enea Zaffanella
>> <zaffanella at cs.unipr.it> wrote:
>>> In include/clang/AST/RawCommentList.h we have
>>>
>>> class RawComment {
>>> public:
>>>   enum CommentKind {
>>>     CK_Invalid,      ///< Invalid comment
>>>     [...]
>>>
>>> In include/clang/AST/OperationKinds.h the following macro is defined
>>>
>>> #define CK_Invalid ((CastKind) -1)
>>
>> Hi Enea,
>>
>> Thank you for noticing!
>>
>> Here is a patch that should fix this.
>>
>> Please review.
>>
>> Dmitri
>
> It's possible the reason this isn't used is because CastKind would otherwise be only positive numbers and thus suitable for storing in an unsigned bitfield without complaint. Maybe ~0U would be a better choice of constant?

Is there any reason why CK_Invalid has an all-ones value?  (We could
add it to enum without an initializer)

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/




More information about the cfe-commits mailing list