[llvm] [IR] Modernize StructuralHashImpl (NFC) (PR #105951)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 24 10:46:35 PDT 2024


================
@@ -43,7 +43,7 @@ class StructuralHashImpl {
   }
 
 public:
-  StructuralHashImpl() : Hash(4) {}
+  StructuralHashImpl() = default;
----------------
kazutakahirata wrote:

AFAIK, under `public:`, it's for the readers, not the generated code.  Providing the defaulted default constructor tells the readers that the defaulted default constructor is available (provided that the code compiles with `-Werror`).  If the class contained a member that is not default constructible, then an attempt to declare the defaulted default constructor would trigger a warning (see https://godbolt.org/z/7vTGYb6Pn).


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


More information about the llvm-commits mailing list