mem: Make slicc generate some default methods explicitly.
authorGabe Black <gabeblack@google.com>
Thu, 30 Jan 2020 07:50:25 +0000 (23:50 -0800)
committerGabe Black <gabeblack@google.com>
Fri, 31 Jan 2020 09:03:42 +0000 (09:03 +0000)
Implicitly using the default copy constructor and assignment operator
is apparently deprecated, and gcc 9 will warn about it, breaking the
build.

Change-Id: Ida7a8a577e9d1cde9841eac7eee1af74563f1e27
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24927
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bradford Beckmann <brad.beckmann@amd.com>
Reviewed-by: John Alsop <johnathan.alsop@amd.com>
Maintainer: Bradford Beckmann <brad.beckmann@amd.com>

src/mem/slicc/symbols/Type.py

index c4d8eae06c1c544ba318df2e82d90eef51784001..8464544e903dc6dd3b62f29c335dbc7f719f414f 100644 (file)
@@ -258,6 +258,13 @@ $klass ${{self.c_ident}}$parent
 
             code.dedent()
             code('}')
+        else:
+            code('${{self.c_ident}}(const ${{self.c_ident}}&) = default;')
+
+        # ******** Assignment operator ********
+
+        code('${{self.c_ident}}')
+        code('&operator=(const ${{self.c_ident}}&) = default;')
 
         # ******** Full init constructor ********
         if not self.isGlobal: