aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorMichael Kruse <llvm-project@meinersbur.de>2020-12-14 11:05:51 -0600
committerMichael Kruse <llvm-project@meinersbur.de>2020-12-14 14:07:05 -0600
commit2aa43358060c6b34fb9cdc6c4321e958f62331e7 (patch)
tree7f6abfd4e6feaa1ea320ba7c99f9cf3d1d6b8ead /clang/lib/Lex/ModuleMap.cpp
parent6bc9439f59acbcc5e46a108c2f74a4d5ffe55a3b (diff)
downloadllvm-2aa43358060c6b34fb9cdc6c4321e958f62331e7.zip
llvm-2aa43358060c6b34fb9cdc6c4321e958f62331e7.tar.gz
llvm-2aa43358060c6b34fb9cdc6c4321e958f62331e7.tar.bz2
[flang] Fix copy elision assumption.
Before this patch, the Restorer depended on copy elision to happen. Without copy elision, the function ScopedSet calls the move constructor before its dtor. The dtor will prematurely restore the reference to the original value. Instead of relying the compiler to not use the Restorer's copy constructor, delete its copy and assign operators. Hence, callers cannot move or copy a Restorer object anymore, and have to explicitly provide the reset state. ScopedSet avoids calling move/copy operations by relying on unnamed return value optimization, which is mandatory in C++17. Reviewed By: klausler Differential Revision: https://reviews.llvm.org/D88797
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions