compiler: workaround for C++ build template matching quirk
authorThan McIntosh <thanm@google.com>
Tue, 5 Oct 2021 20:25:45 +0000 (16:25 -0400)
committerIan Lance Taylor <iant@golang.org>
Tue, 5 Oct 2021 22:06:19 +0000 (15:06 -0700)
Tweak a couple of places in the types code to use nullptr instead of
NULL to work around a template matching quirk when using certain build
compilers.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/354151

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/types.cc

index 7eea977..affba73 100644 (file)
@@ -1,4 +1,4 @@
-bbc1effb1a8a757a38011074f1d4477fae3936f5
+925ace70ac7426c3f8b5c0bfb75aa9601f071de4
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index c6ce623..0f66661 100644 (file)
@@ -2259,7 +2259,7 @@ Named_object*
 Type::build_equal_function(Gogo* gogo, Named_type* name, int64_t size,
                           Function_type* equal_fntype)
 {
-  std::pair<Type*, Named_object*> val(name != NULL ? name : this, NULL);
+  std::pair<Type*, Named_object*> val(name != NULL ? name : this, nullptr);
   std::pair<Type_function::iterator, bool> ins =
     Type::type_equal_functions_table.insert(val);
   if (!ins.second)
@@ -6413,7 +6413,7 @@ Struct_type::interface_method_table(Interface_type* interface,
                                    bool is_pointer)
 {
   std::pair<Struct_type*, Struct_type::Struct_method_table_pair*>
-    val(this, NULL);
+    val(this, nullptr);
   std::pair<Struct_type::Struct_method_tables::iterator, bool> ins =
     Struct_type::struct_method_tables.insert(val);