-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClangDocWarning.cpp
More file actions
56 lines (49 loc) · 1.57 KB
/
ClangDocWarning.cpp
File metadata and controls
56 lines (49 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* \file ClangDocWarning.cpp
* \brief Clang - warn about incorrect Doxygen documentation
*
* \see Build.sh - for Clang build with `-Wdocumentation` flag
*/
#include <iostream>
//--------------------------------------------------------------------------------------------------
/**
* Add two integers.
*
* \param a The first integer.
* \param b The second integer.
* \return The sum of the two integers.
*/
int add(int a, int b)
{
return a + b;
}
//--------------------------------------------------------------------------------------------------
/**
* Subtract two integers.
*
* \param a The first integer.
* \param wrong_param_name The second integer (Incorrect parameter name here).
* \return The difference of the two integers.
*/
int subtract(int a, int b)
{
return a - b;
}
//--------------------------------------------------------------------------------------------------
int main(int, char **)
{
std::cout << add(5, 3) << std::endl;
std::cout << subtract(5, 3) << std::endl;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------------------------------------
#if OUTPUT
ClangDocWarning.cpp:31:12: warning: parameter 'wrong_param_name' not found in the function declaration [-Wdocumentation]
* \param wrong_param_name The second integer (Incorrect parameter name here).
^~~~~~~~~~~~~~~~
ClangDocWarning.cpp:31:12: note: did you mean 'b'?
* \param wrong_param_name The second integer (Incorrect parameter name here).
^~~~~~~~~~~~~~~~
b
1 warning generated.
#endif