<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 after bad typo correction"
   href="https://bugs.llvm.org/show_bug.cgi?id=38189">38189</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure after bad typo correction
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rtrieu@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In the following example, the using declaration is incorrect since it refers to
a non-existent class.  Clang attempts to typo-correct this, but the correction
is a function instead of a class.  This later triggers an assertion.

$ cat test.cc
template <class T>
struct ptr {
  ptr(T*);
};

namespace NS {
struct _First__End_ {
  static ptr<_First__End_> New_SecondPart__End_();
};
}  // namespace NS

using NS::_First__SecondPart__End_;

void run() {
  ptr<_First__SecondPart__End_> un = _First__SecondPart__End_::NewInstance();
}

$ clang test.cc
test.cc:12:7: error: no member named '_First__SecondPart__End_' in namespace
      'NS'; did you mean 'NS::_First__End_::New_SecondPart__End_'?
using NS::_First__SecondPart__End_;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      NS::_First__End_::New_SecondPart__End_
test.cc:8:28: note: 'NS::_First__End_::New_SecondPart__End_' declared here
  static ptr<_First__End_> New_SecondPart__End_();
                           ^
test.cc:15:7: error: use of undeclared identifier '_First__SecondPart__End_';
      did you mean 'New_SecondPart__End_'?
  ptr<_First__SecondPart__End_> un = _First__SecondPart__End_::NewInstance();
      ^~~~~~~~~~~~~~~~~~~~~~~~
      New_SecondPart__End_
test.cc:12:11: note: 'New_SecondPart__End_' declared here
using NS::_First__SecondPart__End_;
          ^
clang-7.0: ../tools/clang/lib/Sema/SemaExprMember.cpp:91: IMAKind
ClassifyImplicitMemberAccess(clang::Sema &, const clang::LookupResult &):
Assertion `!R.empty() && (*R.begin())->isCXXClassMember()' failed.</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>