[clang] [Clang] Add [[clang::complete_on_member_instantiation]] (PR #211231)

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 07:43:55 PDT 2026


philnik777 wrote:

I could see that it would be useful to have an attribute `[[clang::container(T, additional-properties)]]`. The type this is applied to would be guaranteed to fulfill [container.requirements] as well as whatever other properties `additional-properties` require.
Initial ideas for `additional-properties`:
- "sequence-container" for [sequence.reqmts]
- "node-container" for [container.node]
- "associative-container" for [associative.reqmts]
- "reversible-container" for [container.rev.reqmts]
- "allocator-aware-container"(Alloc) for [container.alloc.reqmts]
- "enforce-allocator-requirements" to diagnose incorrect allocators
- "enforce-completeness-requirements" for the initial goal of this patch

We of course wouldn't want to allow nonsensical combinations like "sequence-container" and "associative-container" or "enforece-allocator-requirements" without "allocator-aware-container".

I'm not quite sure whether "allocator-aware-container" should be done in that way, but that seems like a rather niche detail.

WDYT? Is that a direction worth pursuing?


https://github.com/llvm/llvm-project/pull/211231


More information about the cfe-commits mailing list