File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -641,6 +641,20 @@ Improvements to Clang's diagnostics
641
641
642
642
- Clang now diagnoses dangling references for C++20's parenthesized aggregate initialization (#101957).
643
643
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
+
644
658
Improvements to Clang's time-trace
645
659
----------------------------------
646
660
Original file line number Diff line number Diff line change @@ -40,13 +40,6 @@ class FriendEqDefaultCompareOutOfClass {
40
40
41
41
bool operator ==(const FriendEqDefaultCompareOutOfClass &, const FriendEqDefaultCompareOutOfClass &) = default ;
42
42
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
-
50
43
class HasUnusedField {
51
44
int unused_; // expected-warning{{private field 'unused_' is not used}}
52
45
};
You can’t perform that action at this time.
0 commit comments