aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse.h
diff options
context:
space:
mode:
authorSimon Cook <simon.cook@embecosm.com>2022-04-12 16:45:56 +0200
committerSimon Cook <simon.cook@embecosm.com>2022-04-12 16:45:56 +0200
commit1a3f38a2b0b7a1d13a934952f74a4a910035e72b (patch)
treed9528e076ff348fc2401f296e63fcb0695bccea4 /gcc/rust/parse/rust-parse.h
parent68458036c81d141a3899ac4e6ec6ddf0fdfde174 (diff)
downloadgcc-1a3f38a2b0b7a1d13a934952f74a4a910035e72b.zip
gcc-1a3f38a2b0b7a1d13a934952f74a4a910035e72b.tar.gz
gcc-1a3f38a2b0b7a1d13a934952f74a4a910035e72b.tar.bz2
rust: Allow gccrs to build on x86_64-apple-darwin with clang/libc++
This makes changes to the includes such that gccrs can be built with clang/libc++, and for x86_64-apple-darwin. Similarly, a couple of changes have been made to creating MacroInvocations and wrapping into ExprOrStmts for libc++ compatibility.
Diffstat (limited to 'gcc/rust/parse/rust-parse.h')
-rw-r--r--gcc/rust/parse/rust-parse.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h
index 945bce7..fcfcf18 100644
--- a/gcc/rust/parse/rust-parse.h
+++ b/gcc/rust/parse/rust-parse.h
@@ -40,6 +40,11 @@ struct ExprOrStmt
// statement constructor
ExprOrStmt (std::unique_ptr<AST::Stmt> stmt) : stmt (std::move (stmt)) {}
+ // macro constructor
+ ExprOrStmt (std::unique_ptr<AST::MacroInvocation> macro)
+ : expr (std::move (macro))
+ {}
+
// Returns whether this object is in an error state.
bool is_error () const
{