[all-commits] [llvm/llvm-project] a6614e: [APINotes] Diagnose invalid Where.Parameters selec...

StoeckOverflow via All-commits all-commits at lists.llvm.org
Wed Jul 29 01:50:58 PDT 2026


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

  Changed paths:
    M clang/include/clang/APINotes/APINotesReader.h
    M clang/include/clang/APINotes/Types.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/APINotes/APINotesFormat.h
    M clang/lib/APINotes/APINotesReader.cpp
    M clang/lib/APINotes/APINotesTypes.cpp
    M clang/lib/APINotes/APINotesYAMLCompiler.cpp
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaAPINotes.cpp
    A clang/lib/Sema/SemaAPINotesInternal.h
    A clang/test/APINotes/where-parameters-diagnostics.cpp

  Log Message:
  -----------
  [APINotes] Diagnose invalid Where.Parameters selectors (#209408)

This PR adds diagnostics for exact `Where.Parameters` selectors on top
of the existing parsing, serialization, and Sema matching support.

It diagnoses duplicate exact selectors during API notes conversion,
including duplicate `Where.Parameters: []`, while still allowing broad
name-only entries and same-name entries with different selectors.

It also adds reader/Sema support to warn under `-Wapinotes` when an
exact selector in API notes does not match any visible overload. The
reader can now enumerate stored exact selectors for global functions and
C++ methods, and Sema compares those against the selector candidates
derived from the visible overload set.

The diagnostic path follows the same matching policy as Sema, including
the desugared alias fallback, so valid matched selectors do not produce
false warnings.

Tests cover duplicate selector errors, unmatched selector warnings for
globals and C++ methods, broad-plus-exact coexistence, exact notes not
silently applying on mismatch, and no false warnings for matched or
alias-fallback selectors.

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