<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - Warn on reserved symbol names"
   href="http://llvm.org/bugs/show_bug.cgi?id=18371">18371</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Warn on reserved symbol names
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jj@medical-insight.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The C++ (11 is the one I checked) standard - in section 17.6.4.3 spells out the
rules about a number of symbol names that are reserved for the implementation.
For example; names containing double underscore, names starting with underscore
in the global namespace, names from the Standard C library declared with
external linkage, etc (there are also some reserved names imported by the
inclusion of the C/Posix standard(s) I believe).

It would be great if clang could warn on uses of symbol names (including
macros) that clash with names reserved by the standard.

This warning whould probably not be part of something like -Wall or -Wextra
since it will probably be quite noisy for many code bases (at least I know that
I've seen my fair share of codebases that happily uses standard-reserved names
all over the place) and there's also the fact that implementors of things like
STL would *not* want this warning enabled for their code.
But if it could just be something that one could explicitly enable (like
-Wreserved-identifier or something) as well as being part of -Weverything then
that would be a real help in getting a lot of code cleaned up.</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>