Hello,<br><br>These two patches enrich the actual diagnostic by adding 3 fields:<br>- name<br>- brief description<br>- full description<br><br>This is a first step in providing self-documenting user-friendly diagnostics, where the user can get help (both immediately and on-line) about the meaning of a particular diagnostic.<br>
<br>The brief and full description are for now unused, this will come in future patches.<br><br><br>The interface changes can be summed up by:<br><br>+ 2 new driver flags:<br><br><div style="margin-left: 40px;">-fdiagnostics-show-name  (activated by default)<br>
-fno-diagnostics-show-name<br></div><br>+ 4 new static functions in  DiagnosticIDs<br><br><div style="margin-left: 40px;">const char *DiagnosticIDs::getName(unsigned DiagID)<br>unsigned DiagnosticIDs::getIdFromName(char const *Name)<br>
<br>const char *DiagnosticIDs::getBriefExplanation(unsigned DiagID)<br>const char *DiagnosticIDs::getFullExplanation(unsigned DiagID)<br></div><br><br>Here is an example of the new output:<br><br><div style="margin-left: 40px;">
$ clang++ error.cpp<br>error.cpp:1:5: error: second parameter of 'main' (argument array) must be of type 'char **' [main_arg_wrong]<br>
int main(int, char*) {<br>    ^<br>1 error generated.<br></div><br><div style="margin-left: 40px;">$ clang++ -Wunused-parameter warning.cpp<br>warning.cpp:1:21: warning: unused parameter 'argv' [unused_parameter] [-Wunused-parameter]<br>

int main(int, char* argv[]) { // expected-warning{{unused parameter 'argv'}}<br>                    ^<br>1 warning generated.<br><br></div>The name of the diagnostic can be seen appearing in brackets.<br><br><br>
The patch also includes a small test which verifies that the name is correctly printed (and the right name, at that), located in  test/Frontend<br><br><br>The llvm part of this patch is simply an alteration of the TableGen utility to introduce the new fields. The llvm and clang part are intimately tied and should be either both applied or both avoided/rolled back.<br>