LLVM Project BlogDominic Stöcker8 min readintermediate
GSoC 2026: Extending Clang API Notes for C++: Overload-Specific Annotations for Functions and Methods
Summary
Clang’s API Notes now support overload‑specific selectors via a new optional `Where` block that can match parameter lists and implicit object qualifiers. The implementation adds YAML parsing, binary serialization, Sema integration and diagnostics while preserving existing name‑only behavior.
- A `Where` block with `Parameters` and `Object` selectors lets API Notes target individual C++ overloads.
- Selector normalization handles type aliases, whitespace, and strips top‑level const/volatile that don’t affect overload identity.
- `Where.Object` captures const, volatile, and ref‑qualifiers of the implicit object, distinguishing const vs non‑const and lvalue/rvalue overloads.
- Implementation spanned YAML model changes, binary format updates, declaration lookup, Sema integration, and added diagnostics for malformed selectors.
C++/Swift interop engineers and Clang developers should care because it enables precise per‑overload annotations without breaking existing API Notes.
6/10
