Author Topic: CC: does not list "allocate", a member function of std::allocator.  (Read 17849 times)

Offline edison

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: CC: does not list "allocate", a member function of std::allocator.
« Reply #15 on: September 05, 2014, 06:50:05 am »
The svn 9884 build for ubuntu of Jen's does works, allocate() show in the CC list.

So it is Windows only problem?

Offline Huki

  • Multiple posting newcomer
  • *
  • Posts: 95
Re: CC: does not list "allocate", a member function of std::allocator.
« Reply #16 on: September 05, 2014, 04:46:08 pm »
If there are multiple copies of the header file I'm not sure which one the code completion plugin will use (or even whether it consistently uses the same header). And mingw-w64 has different files like these:
Code
\mingw32\lib\gcc\i686-w64-mingw32\4.8.1\include\stdint.h
\mingw32\i686-w64-mingw32\include\stdint.h
etc..

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6036
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CC: does not list "allocate", a member function of std::allocator.
« Reply #17 on: September 05, 2014, 04:59:18 pm »
If there are multiple copies of the header file I'm not sure which one the code completion plugin will use (or even whether it consistently uses the same header). And mingw-w64 has different files like these:
Code
\mingw32\lib\gcc\i686-w64-mingw32\4.8.1\include\stdint.h
\mingw32\i686-w64-mingw32\include\stdint.h
etc..

CC first try to locate all the search dirs when start a "batch parse"
See: const wxArrayString& NativeParser::GetGCCCompilerDirs(const wxString &cpp_compiler)

When parsing files, it see the #include "xxx.h", then try to search xxx.h file through all the search dirs, and use the first found file, see
wxString ParserBase::GetFullFileName(const wxString& src, const wxString& tgt, bool isGlobal)

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.

Offline edison

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: CC: does not list "allocate", a member function of std::allocator.
« Reply #18 on: September 09, 2014, 06:19:52 pm »
I did add "allocate" to the 2nd Keywords set(settings -> editor -> syntax highlighting), the color of "allocate" was changed as the keyword color setting. But CC still not worked when typing allocate as a member function of a allocator object and set -std=c++11 in compiler settings(Windows 8.1).

btw, Can cb_share_config transfer Keywords setting ? it seems not works via transfer syntax highlighting settings.
« Last Edit: September 09, 2014, 06:23:21 pm by edison »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6036
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CC: does not list "allocate", a member function of std::allocator.
« Reply #19 on: September 10, 2014, 04:34:38 am »
But CC still not worked when typing allocate as a member function of a allocator object and set -std=c++11 in compiler settings(Windows 8.1).
I guess it is a parse issue by our CC parser, but sorry I can't reproduce this bug in my testing environment. :(
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.

Offline edison

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: CC: does not list "allocate", a member function of std::allocator.
« Reply #20 on: September 10, 2014, 08:47:42 am »
if you can find a windows pc, than you can try it:
http://1drv.ms/1ukjCya (svn 9884 w/tdm-gcc 4.8.1 portable clean setup, I had reproduced the bug on 3 windows setup with this portable pack).
« Last Edit: September 10, 2014, 08:51:32 am by edison »