[all-commits] [llvm/llvm-project] 150bf6: [Clang][Sema] Disallow applying `onwership_returns...

Pavel Skripkin via All-commits all-commits at lists.llvm.org
Mon Jul 29 09:44:12 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 150bf637baad2ba4df6369600b65d897ed9b31a7
      https://github.com/llvm/llvm-project/commit/150bf637baad2ba4df6369600b65d897ed9b31a7
  Author: Pavel Skripkin <paskripkin at gmail.com>
  Date:   2024-07-29 (Mon, 29 Jul 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/test/AST/attr-print-emit.cpp
    M clang/test/Sema/attr-ownership.c
    M clang/test/Sema/attr-ownership.cpp

  Log Message:
  -----------
  [Clang][Sema] Disallow applying `onwership_returns` to functions that return non-pointers (#99564)

`onwership_returns` works only with pointers, since it models
user-defined memory allocation functions. Make semantics more clear and
report an error if attribute is attached to wrong function.

Closes #99501



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