A function pointer loses it's parameters when viewing the type. It's quite annoying to use OpenGL with KDevelop because the functions are used through function pointers and the KDevelop's autocompletion popup thingie doesn't tell anything about the function's parameters. GLEW (OpenGL Wrapper library) makes things even more dirty by using macros for the functions, and then it's impossible to autocomplete the function's (=macro's) name. Reproducible: Always Steps to Reproduce: 1. Create a new C++ project 2. Copy and paste this to the main function: void (*funcptr)(int x); funcptr(0); 3. Autocomplete funcptr and see what kind of parameters it takes (ctrl+space) Actual Results: It tells that the type is void *funcptr. Expected Results: It should tell the correct type for the function pointer, with it's parameters. It seems that in GLEW the function pointers are wrapped in macros like this: #define GLEW_GET_FUN(x) x #define glUseProgram GLEW_GET_FUN(__glewUseProgram) And it's not possible to autocomplete the macro "glUseProgram"
Git commit 81ec5b516fb1ea21fc5344ccf71488bbdec1f649 by Milian Wolff. Committed on 28/01/2013 at 00:52. Pushed by mwolff into branch '4.5'. Add basic support for typedef'ed function pointers. Properly deduce the function type and create correct declarations with the identifier of the sub_declaration id in cases such as: void (*funcptr)(int x); funcptr myFunc; int main() { myFunc(0); } Related: bug 286208 DIGEST: M +20 -4 languages/cpp/cppduchain/declarationbuilder.cpp M +12 -4 languages/cpp/cppduchain/tests/test_duchain.cpp http://commits.kde.org/kdevelop/81ec5b516fb1ea21fc5344ccf71488bbdec1f649
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively