New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doxygen thinks C++ class is Objective-C (Origin: bugzilla #746361) #5763

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.8.9.1-GIT on platform Other
Assigned to: Dimitri van Heesch

Original attachment names and IDs:

On 2015-03-17 19:51:04 +0000, rob.nikander@gmail.com wrote:

Created attachment 299623
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.

On 2015-03-18 11:32:25 +0000, albert wrote:

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.

On 2015-03-18 14:11:11 +0000, rob.nikander@gmail.com wrote:

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.

On 2015-03-18 14:24:31 +0000, albert wrote:

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).

On 2015-12-27 11:23:43 +0000, Dimitri van Heesch wrote:

Confirmed. Should be fixed in the next GIT update.

On 2015-12-30 10:20:19 +0000, Dimitri van Heesch wrote:

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).

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment