summaryrefslogtreecommitdiff
path: root/src/ast/expr_ptr.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-08-23 07:39:43 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-08-23 07:39:43 +0800
commit980eac10e4f7948f00c4d9c8f028d9f2f1ce38b5 (patch)
tree965c1b40df6f04a954e63541031f4a91f6b6d015 /src/ast/expr_ptr.hpp
parent0e436bf3b8c83c9c4c9976415ef21434df6c58ef (diff)
downloadmrust-980eac10e4f7948f00c4d9c8f028d9f2f1ce38b5.tar.gz
Expand proc_macro - Fix assertion with no-value enum variants
Diffstat (limited to 'src/ast/expr_ptr.hpp')
-rw-r--r--src/ast/expr_ptr.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ast/expr_ptr.hpp b/src/ast/expr_ptr.hpp
index cae519cc..022c548a 100644
--- a/src/ast/expr_ptr.hpp
+++ b/src/ast/expr_ptr.hpp
@@ -23,6 +23,7 @@ public:
Expr(ExprNode* node);
Expr();
+ operator bool() const { return is_valid(); }
bool is_valid() const { return m_node.get() != nullptr; }
const ExprNode& node() const { assert(m_node.get()); return *m_node; }
ExprNode& node() { assert(m_node.get()); return *m_node; }