aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorYizhe <yizhe@pku.edu.cn>2021-03-09 10:54:36 +0000
committerYizhePKU <yizhe@pku.edu.cn>2021-04-02 17:10:44 +0000
commit2ba543eb04c4a724d7e40f48a14088629127821a (patch)
tree5dcf6da101f3e4845ee5a4fff3f3efd2e450e9e2 /gcc
parentd71750b7829b3ef3443c75880e439e3e145aa8a7 (diff)
downloadgcc-2ba543eb04c4a724d7e40f48a14088629127821a.zip
gcc-2ba543eb04c4a724d7e40f48a14088629127821a.tar.gz
gcc-2ba543eb04c4a724d7e40f48a14088629127821a.tar.bz2
Modify parser to generate empty ArrayElemsValues instead of nullptr
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 86b8d94..116328a 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -8723,9 +8723,12 @@ Parser<ManagedTokenSource>::parse_array_expr (
// no array elements
lexer.skip_token ();
- return std::unique_ptr<AST::ArrayExpr> (
- new AST::ArrayExpr (nullptr, std::move (inner_attrs),
- std::move (outer_attrs), locus));
+ std::vector<std::unique_ptr<AST::Expr>> exprs;
+ auto array_elems
+ = Rust::make_unique<AST::ArrayElemsValues> (std::move (exprs));
+ return Rust::make_unique<AST::ArrayExpr> (std::move (array_elems),
+ std::move (inner_attrs),
+ std::move (outer_attrs), locus);
}
else
{