[clang] [clang][Sema] Refine unused-member-function diagnostic message for constructors (PR #84515)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 03:35:52 PDT 2024


================
@@ -76,10 +76,33 @@ struct S {
   struct SVS : public VS {
     void vm() { }
   };
+
+  struct CS {
+    CS() {}
+    CS(bool a) {}
+    CS(int b) {} // expected-warning{{unused constructor 'CS'}}
+    CS(float c);
+  };
+
+  struct DCS : public CS {
+    DCS() = default; // expected-warning{{unused constructor 'DCS'}}
+    DCS(bool a) : CS(a) {} // expected-warning{{unused constructor 'DCS'}}
----------------
tbaederr wrote:

Is the name of the constructor actually useful in this diagostic? It will always be the name of the surrounding class, won't it?

https://github.com/llvm/llvm-project/pull/84515


More information about the cfe-commits mailing list