[all-commits] [llvm/llvm-project] ee71eb: [APINotes] Match function-like Where.Parameters in...

StoeckOverflow via All-commits all-commits at lists.llvm.org
Mon Jul 13 06:36:33 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ee71eb831b6090897df8ae4f843f4b14370131d5
      https://github.com/llvm/llvm-project/commit/ee71eb831b6090897df8ae4f843f4b14370131d5
  Author: StoeckOverflow <95052643+StoeckOverflow at users.noreply.github.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M clang/include/clang/APINotes/APINotesReader.h
    M clang/lib/APINotes/APINotesFormat.h
    M clang/lib/APINotes/APINotesReader.cpp
    M clang/lib/Sema/SemaAPINotes.cpp
    A clang/test/APINotes/Inputs/Headers/WhereParametersSema.apinotes
    A clang/test/APINotes/Inputs/Headers/WhereParametersSema.h
    M clang/test/APINotes/Inputs/Headers/module.modulemap
    A clang/test/APINotes/where-parameters-sema.cpp

  Log Message:
  -----------
  [APINotes] Match function-like Where.Parameters in Sema (#205307)

This PR teaches Sema to apply function-like `Where.Parameters` selectors
for API notes.

It builds on #204147 by using the serialized `Where.Parameters` selector
keys in Sema. For each `FunctionDecl` / `CXXMethodDecl`, Sema derives an
exact parameter selector from the declaration’s `FunctionProtoType`.
Broad name-only API notes lookup still runs first, preserving existing
behavior. If Clang can form a parameter selector, Sema then performs an
exact selector lookup and applies that result second, allowing
overload-specific notes to refine same-name broad notes.

Tests:
- Adds end-to-end module APINotes Sema coverage (`.apinotes` source ->
binary APINotes -> reader lookup -> Sema matching -> AST result)
- Covers core matching behavior for global functions and C++ methods,
including same-name overloads, exact empty selectors, broad-plus-exact
coexistence and mismatched selectors
- Covers important edge cases: default arguments, static methods, alias
spellings remaining non-canonicalized, by-value `const`, namespaced
functions, and overloaded operators.

This PR does not add duplicate-selector or unmatched-selector
diagnostics. Those remain for a follow-up diagnostics PR.

**Note**: this PR was originally stacked on top of #204147. It has now
been rebased on top of main containing those changes, so the remaining
diff should reflect only the top commit specific to this PR.

Reviewers: @Xazax-hun @j-hui @egorzhdan

---------

Co-authored-by: John Hui <updog at j-hui.com>



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