<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 - retain ignored attributes in AST"
   href="https://bugs.llvm.org/show_bug.cgi?id=35861">35861</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>retain ignored attributes in AST
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>aaron@aaronballman.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>One of the goals of the Clang AST is to retain full source fidelity, tracking
not just the semantics of source-level constructs but also the syntactic form
used to reach those semantics. We do not achieve that for attributes; one major
hole is that ignored attributes are discarded entirely.

One possible way to rectify this:

 * build an AST node for IgnoredAttr, and use that for all unknown attributes
 * store a list of tokens on each IgnoredAttr if the attribute has parameters
 * when discarding any known attribute (because it is inappropriately applied
or has invalid attributes), convert it to an IgnoredAttr instead

There are probably better approaches. (In particular, in the "discarding an
otherwise-known attribute case, we don't have the tokens, and it doesn't seem
reasonable to retain them just for this case, so perhaps an IgnoredKnownAttr
that contains an Attr* instead of a list of tokens might work better?)</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>