<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 - Assertion failure (DelayedTypos.empty() && "Uncorrected typos!") in case of multiple typos in expression"
   href="https://bugs.llvm.org/show_bug.cgi?id=34507">34507</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure (DelayedTypos.empty() && "Uncorrected typos!") in case of multiple typos in expression
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>normal
          </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>oranevskyy@accesssoftek.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19115" name="attach_19115" title="Reproducer">attachment 19115</a> <a href="attachment.cgi?id=19115&action=edit" title="Reproducer">[details]</a></span>
Reproducer

If a chain of member function calls has multiple typos in it clang -cc1 fails
with the assertion failure if built with assertion enabled.

To reproduce compile the attached test case:
clang -cc1 typo.cpp

In the expression "z_obj.getY2().getM();" both getY2() and getM() calls are
mistyped. The initial AST for this expression:
  CallExpr 0xcda1b01428 '<dependent type>'
  `-CXXDependentScopeMemberExpr 0xcda1b013d0 '<dependent type>' lvalue .getM
    `-CallExpr 0xcda1b013a8 '<dependent type>'
      `-TypoExpr 0xcda1b01398 '<dependent type>' lvalue

The TypoExpr here stands for the getY2() call.

During typo resolution TransformCXXDependentScopeMemberExpr() detects that
getM() is also a typo and transforms the whole CXXDependentScopeMemberExpr into
a single TypoExpr. The resulting expression after the transformation looks like
this:
  CallExpr 0xcda1b01768 '<dependent type>'
  `-TypoExpr 0xcda1b01758 '<dependent type>' lvalue

This newly created TypoExpr does not get into the TypoExprs container and it is
not processed by the transform, thereby causing the assertion failure with
clang built with assertions enabled or missing typo diagnostics for getM() if
assertions are disabled.</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>