code completion does not work with class bitfield

General questions regarding the usage of CodeLite
solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

code completion does not work with class bitfield

Post by solewalker »

I tried to do some test on bitfields in class and found that bitfield members are not shown in completion box.

Image

Only Members specifying a bit field is not shown. Other members are shown as expected. If all the members are bit fielded none is shown. Code completion is perfectly fine with struct, if I change my class to a struct it works fine, only class has this problem

Code: Select all

#include <stdio.h>
class Bittest
{
public:
   unsigned int MENU : 1 ;
   unsigned int PLAY ;
};
int main (int argc, char ** argv)
{
   Bittest bittest;
   return 0;
}
I am using codelite 5.3 from git on windows7 64 bit
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: code completion does not work with class bitfield

Post by eranif »

Its indentical to this bug (opened by you?)

https://sourceforge.net/p/codelite/bugs/915/

Eran
Make sure you have read the HOW TO POST thread
solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: code completion does not work with class bitfield

Post by solewalker »

Did not notice this bug report. Yes, this is referring to the same problem, but no, its not opened by me. What a coincident, after 5 days the bug is submitted I also noticed this ;)
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: code completion does not work with class bitfield

Post by eranif »

I never used bitfied before - which may explain how come codelite does not support it... I need to update the grammar to include this

Eran
Make sure you have read the HOW TO POST thread
solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: code completion does not work with class bitfield

Post by solewalker »

I have used with struct but struct has no problem, its with only classes
petah
CodeLite Expert
Posts: 231
Joined: Sat Nov 24, 2012 8:04 pm
Genuine User: Yes
IDE Question: c++
Location: Los Angeles
Contact:

Re: code completion does not work with class bitfield

Post by petah »

Bitfields are not generally recommended except at a very low level because of issues like not being able to pass a pointer to a single-bit variable but especially because concurrency is hard to ensure since atomic operations can't happen on less than a byte-level. Stroustrup's 4th edition of the C++ standard mentions these "caveats" serveral times (btw don't get the paperback edition whose loosely-glued pages fly out immediately, the hardcovert just came out).

-- p
main: Debian Jessie x64 + custom wxTrunk
solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: code completion does not work with class bitfield

Post by solewalker »

I too try to avoid them, but for games and other stuffs we have to use bools extensively, someone was using around 14/15 bools in a class for around thousands of objects, using bit fields and some careful declaration of variables he managed to save 178MB of memory. And that's worth saving. While trying bit fields myself I came across this bug in codelite.
Post Reply