Commit 9e951dd6 by Ian Lance Taylor

compiler: make comparison operator() methods const

    
    This is required for new versions of libstdc++ in C++17 mode.
    
    Fixes GCC PR 83102.
    
    Reviewed-on: https://go-review.googlesource.com/79396

From-SVN: r255062
parent 543382b7
178c00f929e6268f24f0c9dd9eb69d3d14d8096e 1db7dc97d01ee230ff4874ce1c9775a24ffd16ac
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -117,7 +117,7 @@ class Import_init ...@@ -117,7 +117,7 @@ class Import_init
// For sorting purposes. // For sorting purposes.
struct Import_init_lt { struct Import_init_lt {
bool operator()(const Import_init* i1, const Import_init* i2) bool operator()(const Import_init* i1, const Import_init* i2) const
{ {
return i1->init_name() < i2->init_name(); return i1->init_name() < i2->init_name();
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
bool bool
Parse::Enclosing_var_comparison::operator()(const Enclosing_var& v1, Parse::Enclosing_var_comparison::operator()(const Enclosing_var& v1,
const Enclosing_var& v2) const Enclosing_var& v2) const
{ {
if (v1.var() == v2.var()) if (v1.var() == v2.var())
return false; return false;
......
...@@ -127,7 +127,7 @@ class Parse ...@@ -127,7 +127,7 @@ class Parse
struct Enclosing_var_comparison struct Enclosing_var_comparison
{ {
bool bool
operator()(const Enclosing_var&, const Enclosing_var&); operator()(const Enclosing_var&, const Enclosing_var&) const;
}; };
// A set of Enclosing_var entries. // A set of Enclosing_var entries.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment