GNOME Bugzilla – Bug 746361
Doxygen thinks C++ class is Objective-C
Last modified: 2015-12-30 10:20:19 UTC
Created attachment 299623 [details] Simple files that demonstrate the problem. I've attached a sample with two source files. If I run `doxygen` in the directory, the C++ classes render in HTML like Objective-C. That is, the methods in the appear like - (void) foo (int) x instead of void foo(int x) This always happens for the class in the .mm file. It happens for the .h file if the the Obj-C forward declaration (@class …) is uncommented.
A .mm file is seen as an Objective-C function by doxygen. This can be overcome by the setting in the Doxyfile: EXTENSION_MAPPING = mm=C++ The .h file contains the setting @class which is the forward declaration statement for Objective-C and not for C++ and this it is correct that here a switch takes place to Objective-C I think this is not a bug but a usage problem.
Apple's compilers support what they call "Objective C++", which is a mix of the two languages, in the same file. So the .mm files, and their headers, can have a mix of both C++ and Objective-C style classes (class and @class, @interface, etc). This is not some weird thing I'm doing. The compiler handles it, and it's near essential on projects that use C++, because you have to create Objective C classes in those files, to integrate with the system's APIs. If doxygen can't handle files with both kinds of class, then I can see how that could be hard to fix, but I don't think it's a usage problem.
At first sight it does look like a usage problem, but apparently there are some compilers and front ends that accept this type of constructs / language variant see e.g. http://en.wikipedia.org/wiki/Objective-C#Objective-C.2B.2B).
Confirmed. Should be fixed in the next GIT update.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.8.11. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant (preferably in the form of a self-contained example).