[all-commits] [llvm/llvm-project] 5ae3fd: [clang] Fix missing diagnostic of declaration use ...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Mon Mar 10 14:39:00 PDT 2025


  Branch: refs/heads/users/mizvekov/GH58547
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ae3fdc935ece6eb8329eb8be219e25a0b8acc93
      https://github.com/llvm/llvm-project/commit/5ae3fdc935ece6eb8329eb8be219e25a0b8acc93
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2025-03-10 (Mon, 10 Mar 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/SemaDecl.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp
    M clang/test/Sema/attr-availability-macosx.cpp

  Log Message:
  -----------
  [clang] Fix missing diagnostic of declaration use when accessing TypeDecls through typename access

We were missing a call to DiagnoseUseOfDecl when performing typename access.

This refactors the code so that TypeDecl lookups funnel through a helper which performs all the necessary checks, removing some related duplication on the way.

When diagnosing availability uses through typedefs, this changes the implementation so it won't dig through
subst nodes, as those uses should be diagnosed through the template specialization it was accessed from.
This takes care of the regression reported here: https://github.com/llvm/llvm-project/pull/129681#issuecomment-2710469954

Fixes #58547

Differential Revision: https://reviews.llvm.org/D136533



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