[all-commits] [llvm/llvm-project] abd105: [Clang] Minimal support for availability attribute...

cor3ntin via All-commits all-commits at lists.llvm.org
Mon May 5 10:31:57 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: abd10578653a4f16c81c6a164f6367af64f21194
      https://github.com/llvm/llvm-project/commit/abd10578653a4f16c81c6a164f6367af64f21194
  Author: cor3ntin <corentinjabot at gmail.com>
  Date:   2025-05-05 (Mon, 05 May 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaAvailability.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp

  Log Message:
  -----------
  [Clang] Minimal support for availability attributes on partial specializations (#138426)

There are some limitations.

Because we only know which partial specialization to refer to when
instantiating, and because we can't instantiate the class before we
require a complete type, we can only use the partial specialization once
we have a complete class.

Similarly, because we don't know if a class is ever going to be
complete, we always warn on availability of the primary. Therefore, we
only warn for the partial specialization if we did not warn on the
primary.

I considered alternatives to address that second limitation:
 - Delay warnings to the end of the TU
 - Tracking where each availability attribute originally comes from.

However, both of these have drawbacks, and the use case is probably less
motivated than wanting to deprecate the use of a specific
specialization.

Fixes #44496



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