diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2023-06-05 15:54:08 -0400 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:46:24 +0100 |
commit | 18ba67df507b0c4560200b444f37dce07c6fc803 (patch) | |
tree | 15b635251a90a1761b85985a91e4f559b253218a /gcc | |
parent | b14efcea1f43289aec4dc5b63752111bfc34c911 (diff) | |
download | gcc-18ba67df507b0c4560200b444f37dce07c6fc803.zip gcc-18ba67df507b0c4560200b444f37dce07c6fc803.tar.gz gcc-18ba67df507b0c4560200b444f37dce07c6fc803.tar.bz2 |
gccrs: Prevent initialization related warnings/errors for Optional
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635#c53
gcc/rust/ChangeLog:
* util/rust-optional.h
(class Optional): Add volatile field to union.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/util/rust-optional.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-optional.h b/gcc/rust/util/rust-optional.h index 30880cd..e545c15 100644 --- a/gcc/rust/util/rust-optional.h +++ b/gcc/rust/util/rust-optional.h @@ -86,6 +86,10 @@ private: union { T value; + // prevents initialization warnings + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635#c53 + // FIXME: remove + volatile char unused; }; Optional (tag_some, const T &value) : field_is_some (true), value (value) {} |