Skip to content

Commit d95b9d9

Browse files
committed
Update release notes
1 parent a7885a8 commit d95b9d9

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,20 @@ Improvements to Clang's diagnostics
641641

642642
- Clang now diagnoses dangling references for C++20's parenthesized aggregate initialization (#101957).
643643

644+
- Fixed a bug where Clang would not emit ``-Wunused-private-field`` warnings when an unrelated class
645+
defined a defaulted comparison operator (#GH116270).
646+
647+
.. code-block:: c++
648+
649+
class A {
650+
private:
651+
int a; // warning: private field 'a' is not used, no diagnostic previously
652+
};
653+
654+
class C {
655+
bool operator==(const C&) = default;
656+
};
657+
644658
Improvements to Clang's time-trace
645659
----------------------------------
646660

clang/test/SemaCXX/warn-unused-private-field.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ class FriendEqDefaultCompareOutOfClass {
4040

4141
bool operator==(const FriendEqDefaultCompareOutOfClass &, const FriendEqDefaultCompareOutOfClass &) = default;
4242

43-
class UnusedConstPrivateField {
44-
public:
45-
UnusedConstPrivateField() : unused_(0) {}
46-
private:
47-
const int unused_; // expected-warning{{private field 'unused_' is not used}}
48-
};
49-
5043
class HasUnusedField {
5144
int unused_; // expected-warning{{private field 'unused_' is not used}}
5245
};

0 commit comments

Comments
 (0)