aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.h')
-rw-r--r--gcc/rust/backend/rust-compile-expr.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h
index 1e4aef6..c63479c 100644
--- a/gcc/rust/backend/rust-compile-expr.h
+++ b/gcc/rust/backend/rust-compile-expr.h
@@ -218,6 +218,13 @@ public:
}
return;
+ case HIR::Literal::CHAR: {
+ // FIXME needs wchar_t
+ char c = literal_value->as_string ().c_str ()[0];
+ translated = ctx->get_backend ()->wchar_constant_expression (c);
+ }
+ return;
+
default:
rust_fatal_error (expr.get_locus (), "unknown literal");
return;