Validate immutable variables

This commit is contained in:
Mathias Baumann
2020-04-02 13:52:27 +02:00
committed by chriseth
parent 9a8ca6ca33
commit ac7b31e559
56 changed files with 898 additions and 14 deletions
+18
View File
@@ -62,6 +62,24 @@ class ASTConstVisitor;
class ASTNode: private boost::noncopyable
{
public:
struct CompareByID
{
using is_transparent = void;
bool operator()(ASTNode const* _lhs, ASTNode const* _rhs) const
{
return _lhs->id() < _rhs->id();
}
bool operator()(ASTNode const* _lhs, int64_t _rhs) const
{
return _lhs->id() < _rhs;
}
bool operator()(int64_t _lhs, ASTNode const* _rhs) const
{
return _lhs < _rhs->id();
}
};
using SourceLocation = langutil::SourceLocation;
explicit ASTNode(int64_t _id, SourceLocation const& _location);