llvm-project/clang/lib
Alexandru Octavian Butiu 78d404a11d [clang][c++20] Fix false warning for unused private fields when a class has only defaulted comparison operators.
Fixes bug 50263

When "unused-private-field" flag is on if you have a struct with private
members and only defaulted comparison operators clang will warn about
unused private fields.

If you where to write the comparison operators by hand no warning is
produced.

This is a bug since defaulting a comparison operator uses all private
members .

The fix is simple, in CheckExplicitlyDefaultedFunction just clear the
list of unused private fields if the defaulted function is a comparison
function.

Differential revision: https://reviews.llvm.org/D102186
2021-06-22 18:40:16 +02:00
..
APINotes [clang][APINotes] Fix -Wunused-function warning (NFC) 2021-04-01 09:52:43 +08:00
ARCMigrate [SystemZ][z/OS] Set files in FileRemapper.cpp are text 2021-04-19 07:59:42 -04:00
AST [clang][AST] Set correct DeclContext in ASTImporter lookup table for template params. 2021-06-17 11:20:27 +02:00
ASTMatchers [clang] p1099 using enum part 2 2021-06-08 11:11:46 -07:00
Analysis [ADT] Remove APInt/APSInt toString() std::string variants 2021-06-11 13:19:15 +01:00
Basic [PowerPC] Moving defineXLCompatMacros() definition 2021-06-15 14:25:43 -05:00
CodeGen [OpenMP] Simplify GPU memory globalization 2021-06-22 10:52:46 -04:00
CrossTU [analyzer][ctu] Reland "Avoid parsing invocation list again and again.. 2021-05-25 09:44:13 +02:00
DirectoryWatcher Revert "Re-Revert "DirectoryWatcher: add an implementation for Windows"" 2021-06-19 09:19:52 -07:00
Driver Try to fix clang/test/Driver/cl-include.c failure 2021-06-21 17:19:00 +02:00
Edit [Matrix] Implement C-style explicit type conversions for matrix types. 2021-04-10 11:48:41 +01:00
Format [Format] Fix incorrect pointer/reference detection 2021-06-17 09:34:06 +01:00
Frontend Frontend: Respect -fno-temp-file when creating a PCH 2021-06-17 18:34:10 -07:00
FrontendTool [NFC] Refactor Registry loops to range for 2020-06-19 00:40:10 +01:00
Headers [HIP] Add support functions for C++ polymorphic types 2021-06-21 11:41:07 -04:00
Index [index] Fix performance regression with indexing macros 2021-06-16 10:16:26 -07:00
IndexSerialization [index-while-building] Fix build with -DBUILD_SHARED_LIBS=True 2020-08-20 15:12:56 +01:00
Interpreter [clang] Fix a race condition in the build of clangInterpreter 2021-06-17 10:03:33 -07:00
Lex [ADT] Remove APInt/APSInt toString() std::string variants 2021-06-11 13:19:15 +01:00
Parse [OpenMP] Fix C-only clang assert on parsing use_allocator clause of target directive 2021-06-14 10:36:27 -07:00
Rewrite [clang] DeltaTree::AddDelta - fix "initialization is never read" clang-tidy warning. NFCI. 2021-03-02 15:01:34 +00:00
Sema [clang][c++20] Fix false warning for unused private fields when a class has only defaulted comparison operators. 2021-06-22 18:40:16 +02:00
Serialization [clang][AST] Make `getLocalOrImportedSubmoduleID` work with const `Module*`. NFC. 2021-06-17 17:29:12 -07:00
StaticAnalyzer [clang][Analyzer] Track null stream argument in alpha.unix.Stream . 2021-06-22 11:16:56 +02:00
Testing Fix MSVC "not all control paths return a value" warning. NFC. 2020-06-05 10:45:59 +01:00
Tooling [libTooling] Change `access` stencil to recognize use of `operator*`. 2021-06-16 20:34:00 +00:00
CMakeLists.txt [clang-repl] Recommit "Land initial infrastructure for incremental parsing" 2021-05-13 06:30:29 +00:00