After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746361 - Doxygen thinks C++ class is Objective-C
Doxygen thinks C++ class is Objective-C
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.9.1-GIT
Other Mac OS
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2015-03-17 19:51 UTC by rob.nikander
Modified: 2015-12-30 10:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple files that demonstrate the problem. (108.47 KB, application/x-gzip)
2015-03-17 19:51 UTC, rob.nikander
Details

Description rob.nikander 2015-03-17 19:51:04 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.
Comment 1 albert 2015-03-18 11:32:25 UTC
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.
Comment 2 rob.nikander 2015-03-18 14:11:11 UTC
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.
Comment 3 albert 2015-03-18 14:24:31 UTC
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).
Comment 4 Dimitri van Heesch 2015-12-27 11:23:43 UTC
Confirmed. Should be fixed in the next GIT update.
Comment 5 Dimitri van Heesch 2015-12-30 10:20:19 UTC
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).