aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCohenArthur <arthur.cohen@epita.fr>2021-08-21 17:41:02 +0200
committerCohenArthur <arthur.cohen@epita.fr>2021-08-25 14:18:01 +0200
commit602f5e90c2e1392bd02407095052ee2fde470154 (patch)
tree3db35b7ca1f10df66a244056e36752dd843793bf
parentcc1a2c8699b7812f74dd12c09fc7e38a1f2c6aa7 (diff)
downloadgcc-602f5e90c2e1392bd02407095052ee2fde470154.zip
gcc-602f5e90c2e1392bd02407095052ee2fde470154.tar.gz
gcc-602f5e90c2e1392bd02407095052ee2fde470154.tar.bz2
raii-file: Fix filename member initialization
-rw-r--r--gcc/rust/lex/rust-lex.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/rust/lex/rust-lex.h b/gcc/rust/lex/rust-lex.h
index 1b37a9c..4b2feae 100644
--- a/gcc/rust/lex/rust-lex.h
+++ b/gcc/rust/lex/rust-lex.h
@@ -35,11 +35,15 @@ public:
RAIIFile &operator= (const RAIIFile &other) = delete;
// have to specify setting file to nullptr, otherwise unintended fclose occurs
- RAIIFile (RAIIFile &&other) : file (other.file) { other.file = nullptr; }
+ RAIIFile (RAIIFile &&other) : file (other.file), filename (other.filename)
+ {
+ other.file = nullptr;
+ }
RAIIFile &operator= (RAIIFile &&other)
{
close ();
file = other.file;
+ filename = other.filename;
other.file = nullptr;
return *this;