Skip to content
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

API documentation on template function in template class with implementation #1025

Closed
GMercat opened this issue Jan 2, 2017 · 6 comments · Fixed by #1029
Closed

API documentation on template function in template class with implementation #1025

GMercat opened this issue Jan 2, 2017 · 6 comments · Fixed by #1029
Assignees
Labels
Milestone

Comments

@GMercat
Copy link

GMercat commented Jan 2, 2017

Thanks for correction about #1000 issue, but i have a last issue 'Undocumented API' in a similar case.

It's the same case, but in test.impl.h file the functionTest() templated have implementation.

In test.h file:

/**
 * @brief DOCUMENTATION CLASS
 */
template <class U>
class TestClass {

[...]

public:
/**
 * @brief DOCUMENTATION FUNCTION
 */
template <class T>
void functionTest();
};

#include "test.impl.h"

In test.impl.h file:

[...]

/**
 * @brief DOCUMENTATION FUNCTION
 */
template <class U>
template <class T>
void TestClass::functionTest()
{
    // Do something
    ...
}

In this case, i have "Undocumented API: functionTest" on TestClass::functionTest in "test.impl.h". If a remove implementation, i haven't issue.

Can you fix this in the 0.9.7 version or it's too late ?

sonarqube : v5.6.3
sonar-cxx : v0.9.7-SNAPSHOT (git commit: ac3d1d9)

@guwirth guwirth added this to the 0.9.7 milestone Jan 2, 2017
@guwirth
Copy link
Collaborator

guwirth commented Jan 2, 2017

@GMercat thx for reporting the issue. Do you have other problems using the public API sensor or is this the last issue you have?

@GMercat
Copy link
Author

GMercat commented Jan 2, 2017

@guwirth Thanks for your reactivity. No, this is really the last issue i have.

@guwirth
Copy link
Collaborator

guwirth commented Jan 2, 2017

@GMercat looking to your sample:

  • it's an issue that you get 'Undocumented API' in test.impl.h
  • it would be not an issue if comment is missing in In test.impl.h because normally only declaration is checked and not definition. In your sample functionTest is documented twice.

Is that also your understanding?

@GMercat
Copy link
Author

GMercat commented Jan 2, 2017

@guwirth Yes that's it.

In my example, functionTest is documented twice. But whatever I do in test.impl.h I get Undocumented API on void TestClass::functionTest()line in test.impl.h.

@guwirth
Copy link
Collaborator

guwirth commented Jan 8, 2017

@GMercat please try with latest snapshot.

To be consistent you have to document ’TestClass::functionTest’. The sensor is currently not able to distinguish between declaration and definition and to detect if the one or the other has a documentation.

@GMercat
Copy link
Author

GMercat commented Jan 9, 2017

@guwirth It's tested and it works ! Thanks again for your reactivity.

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

Successfully merging a pull request may close this issue.

2 participants