[all-commits] [llvm/llvm-project] a4fbc0: Clang: Don't warn about unused private fields of t...

Hans via All-commits all-commits at lists.llvm.org
Wed Aug 30 00:07:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a4fbc091846206fb6f5bc36115d65075764b51ea
      https://github.com/llvm/llvm-project/commit/a4fbc091846206fb6f5bc36115d65075764b51ea
  Author: Hans Wennborg <hans at chromium.org>
  Date:   2023-08-30 (Wed, 30 Aug 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/test/SemaCXX/warn-unused-private-field.cpp

  Log Message:
  -----------
  Clang: Don't warn about unused private fields of types declared maybe_unused

The compiler should not warn on code such as:

  class [[maybe_unused]] MaybeUnusedClass {};
  class C {
    MaybeUnusedClass c;
  };

Patch based on comments on the bug by Shafik and Aaron.

Fixes #61334

Differential revision: https://reviews.llvm.org/D159083




More information about the All-commits mailing list