Author |
Topic |
|
wellental1
New Member
6 Posts |
Posted - Apr 05 2012 : 06:44:18 AM
|
Hello! In our productive code, it seems like vax is parsing some macros the wrong way. especially this one drives me crazy:
flagenum.h #define FLAG_ENUM(_N) \ enum _N; \ \ static _N operator|(_N a, _N b) { return (_N)( (int)a | (int)b ); } \ static _N operator|=(_N& a, _N b) { return a = a | b; } \ static _N operator&(_N a, _N b) { return (_N)( (int)a & (int)b ); } \ static _N operator&=(_N& a, _N b) { return a = a & b; } \ static _N operator^(_N a, _N b) { return (_N)( (int)a ^ (int)b ); } \ static _N operator^=(_N& a, _N b) { return a = a ^ b; } \ static _N operator>>(_N a, int b) { return (_N)( (int)a >> b ); } \ static _N operator>>=(_N& a, int b) { return a = a >> b; } \ static _N operator<<(_N a, int b) { return (_N)( (int)a << b ); } \ static _N operator<<=(_N& a, int b) { return a = a << b; } \ static _N operator~(_N a) { return (_N)( ~(int)a ); } \ enum _N
If i define a flag-enum (vgd_freedomdegrees.h below) and use it the way, shown in somefile.cpp below, it is being colored correctly within the editor, but code-completion doesn't provide anything after typing :: behind the flag-enum's name. "Add include" from the refactor-menu doesn't work, also.
vgd_freedomdegrees.h #include <flagenum.h> #pragma warning(disable:4482)
FLAG_ENUM( VGD_FreedomDegrees ) { VFD_MoveHorizontal = 1, VFD_MoveVertical = 2, VFD_ScaleHorizontal = 4, VFD_ScaleVertical = 8, VFD_Move = VFD_MoveHorizontal | VFD_MoveVertical, VFD_Scale = VFD_ScaleHorizontal | VFD_ScaleVertical, VFD_All = VFD_Move | VFD_Scale };
somefile.cpp VGD_FreedomDegrees JOB_VisualTaskObject::GetFreedomDegrees() const { return VGD_FreedomDegrees::VFD_Move | VGD_FreedomDegrees::VFD_ScaleHorizontal; }
I already tried setting the LimitMacroParsing and LimitMacro registry-keys, rebuilt the symbol-database, but it didn't resolve the problem. Is there any other setting, i could try?
thx in advance,
max |
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Apr 05 2012 : 6:46:28 PM
|
What Visual Studio and Visual Assist versions are you using? I have picked 2 random combinations (VS2008 SP1 with VA1862 and VS11 beta with VA1903) and the listbox has worked for me in your example code:
The covered little tomatoes behind the listbox's icons mean that the list items are generated by VA, not Visual Studio.
Can you please try if you can reproduce the problem in a clean new win32 test project with the recursive macro parsing settings turned off? (so limiting macro parsing again, I was also using this default setting) |
Edited by - accord on Apr 05 2012 6:57:08 PM |
|
|
wellental1
New Member
6 Posts |
Posted - Apr 06 2012 : 5:23:01 PM
|
We are using VS2010SP1 VA1901. Made a blank console project, reset reg-keys, rebuilt symbol-database and cleared cache -> no effect... The problem seems to be machine- and project-independent, as all my fellows here are experiencing the same problem. If needed, i can send you a complete project-package containing all the files and project-settings, so you could try to reproduce it with this one. cheers, max |
Edited by - wellental1 on Apr 06 2012 5:26:29 PM |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Apr 10 2012 : 2:03:29 PM
|
That would be helpful, thanks. You can use the following form to send them in: http://www.wholetomato.com/support/contact.asp
Please paste the URL of this topic into the description field so we can match it up. |
|
|
wellental1
New Member
6 Posts |
Posted - Apr 11 2012 : 07:46:51 AM
|
hi accord! the case-id is: 66058. cheers, max |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Apr 11 2012 : 7:50:37 PM
|
I got the project and was able to reproduce the problem, thank you. I have put in a bug report for this:
case=66081 |
Edited by - accord on Apr 11 2012 7:50:49 PM |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Apr 11 2012 : 8:18:08 PM
|
Almost forgot: turning on the following should help as a workaround:
VA Options -> Listboxes -> Get content from default intellisense |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Apr 16 2012 : 1:57:20 PM
|
A workaround is to ensure that flagenum.h ends with a blank line and then forcing a reparse (VAssistX | Tools | Reparse Current File) of the files that include it. |
|
|
wellental1
New Member
6 Posts |
Posted - Apr 17 2012 : 05:52:03 AM
|
Hey Jean! Perfect! That solved the problem! thx, max |
|
|
|
Topic |
|