Author Topic: Code Completion Issue  (Read 2408 times)

Offline LazyCoder

  • Single posting newcomer
  • *
  • Posts: 6
Code Completion Issue
« on: July 19, 2015, 07:45:17 am »
Hi everyone...

Code::Blocks Nightly Build Rev.10341

CC fails in recognizing C++ enums that have an explicit type specifier.
For example:
Code
enum Colors: char { Red, Green, Blue };
or
Code
enum class Colors: char { Red, Green, Blue };
The Colors enum is NOT recognizable at all by CC!

But still, CC can recognize the following forms:
Code
enum Colors { Red, Green, Blue };
enum class Colors { Red, Green, Blue };

So, the problem seems to be with the explicit type specifiers.

Regards.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code Completion Issue
« Reply #1 on: July 21, 2015, 05:40:02 am »
Thanks for reporting this bug.

I have a patch to fix this issue, but the patch is not in trunk now, see: Code::Blocks / Tickets / #176 Code completion fails with enums whose underlying types are specified (in C++11).
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.