bugKimwitu++ - Bugs: bug #7375, Want up-casting operators

 
 

bug #7375: Want up-casting operators

Submitted by:  Martin v. Loewis <loewis>
Submitted on:  Thu 22 Jan 2004 08:59:48 AM UTC  
 
Category: code generationSeverity: 1 - Wish
Priority: 5 - NormalStatus: Confirmed
Assigned to: Michael Piefel <piefel>Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 22 Jan 2004 08:59:48 AM UTC, original submission:

Recent g++ releases reject the code generated for

ausdruck: ZAHL(integer) | TEXT(casestring);

ausdruck combine(bool cond, int z, char *s)
{
return cond ? ZAHL(mkinteger(z)): TEXT(mkcasestring(s));
}

with the error

error: conditional expression between distinct pointer types `
kc::impl_ausdruck_ZAHL' and `kc::impl_ausdruck_TEXT' lacks a cast

This problem can be resolved by writing

return cond ? static_cast<ausdruck>(ZAHL(mkinteger(z))):
static_cast<ausdruck>(TEXT(mkcasestring(s)));

However, this reformulation is difficult to read,
and may be difficult to write e.g. if the kimwitu code is
generated.

To avoid this kind of problem, and assuming that one
typically does not care about the operator type, anyway,
I'd like to see a different form of the operator, e.g.
spelled as

return cond ? ZAHL_(mkinteger(z)): TEXT_(mkcasestring(s))

Martin v. Loewis <loewis>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by piefel (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 29 Jan 2007 02:37:44 PM UTCpiefelStatusNone=>Confirmed
      Assigned toNone=>piefel

    Back to the top


    Powered by Savane 3.1-cleanup1