[all-commits] [llvm/llvm-project] 802d8d: [Clang] Don't ditch typo-corrected lookup result (...

Younan Zhang via All-commits all-commits at lists.llvm.org
Sat May 10 05:45:06 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 802d8d90776b476ca8f257ab2e4fa2db185c6b69
      https://github.com/llvm/llvm-project/commit/802d8d90776b476ca8f257ab2e4fa2db185c6b69
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2025-05-10 (Sat, 10 May 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp

  Log Message:
  -----------
  [Clang] Don't ditch typo-corrected lookup result (#139374)

For a member function call like 'foo.bar<int>()', there are two
typo-correction points after parsing the dot. The first occurs in
ParseOptionalCXXScopeSpecifier, which tries to annotate the template
name following any scope specifiers.

If the template name bar is not found within 'foo', the parser was
previously instructed to drop any function templates found outside of
the scope. This was intended to prevent ambiguity in expressions like
'foo->bar < 7', as explained in commit 50a3cddd. However, it's
unnecessary to discard typo-corrected results that were strictly
resolved within the scope 'foo'.

We won't perform a second typo-correction in ParseUnqualifiedId after
the name being annotated.

Fixes https://github.com/llvm/llvm-project/issues/139226



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list