<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - C documentation ignored for documented Macros"
   href="https://bugs.llvm.org/show_bug.cgi?id=38858">38858</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>C documentation ignored for documented Macros
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>7.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>libclang
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bo@bowild.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20851" name="attach_20851" title="Example C file that demonstrates the issue.">attachment 20851</a> <a href="attachment.cgi?id=20851&action=edit" title="Example C file that demonstrates the issue.">[details]</a></span>
Example C file that demonstrates the issue.

clang fails to report documentation for Macros.

clang properly reports documentation for most symbols (documentation for
functions and global variables) but fails to report any documentation for
macros.

For IDE purposes, (for example, when using clang with vim or SublimeText3),
this could result in the mistaken belief that no documentation about the macro
exists, even if the macro has specific instructions or warnings documenting
it's existence / use.

This is especially frustrating when using macros to shadow C functions in order
to implement "named arguments" (using a struct and __VA_ARGS__). In these cases
the documentation is totally lost.

The following C file will demonstrate the issue:

```c

/**
 * Function documentation is properly reported to the IDE.
 */
static int my_noop(void) { return 1; }

/**
 * Global variable documentation is also reported to the IDE.
 */
static int my_noop_i = 0;

/**
 * Why does this documentation not show?.
 */
#define NOOP

int main(void) {
  my_noop_i = my_noop();
  NOOP;
  return 0;
}
```

Note: might be related to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Doxygen comments for fields are not detected in PACK macro"
   href="show_bug.cgi?id=35424">bug #35424</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>