Move constructors and operators should be noexcept.
Bug: 121130430
Test: env WITH_TIDY=1 mmm art/libdexfile:libdexfile_support
Change-Id: Id73ec33bdb7d8a334b015935a2c87a1d178ad385
diff --git a/libdexfile/external/include/art_api/ext_dex_file.h b/libdexfile/external/include/art_api/ext_dex_file.h
index 5f64ab1..4a52a2b 100644
--- a/libdexfile/external/include/art_api/ext_dex_file.h
+++ b/libdexfile/external/include/art_api/ext_dex_file.h
@@ -98,11 +98,11 @@
// Minimal std::string look-alike for a string returned from libdexfile.
class DexString final {
public:
- DexString(DexString&& dex_str) { ReplaceExtString(std::move(dex_str)); }
+ DexString(DexString&& dex_str) noexcept { ReplaceExtString(std::move(dex_str)); }
explicit DexString(const char* str = "") : ext_string_(ExtDexFileMakeString(str)) {}
~DexString() { ExtDexFileFreeString(ext_string_); }
- DexString& operator=(DexString&& dex_str) {
+ DexString& operator=(DexString&& dex_str) noexcept {
ReplaceExtString(std::move(dex_str));
return *this;
}
@@ -163,7 +163,7 @@
// thread-safe.
class DexFile {
public:
- DexFile(DexFile&& dex_file) {
+ DexFile(DexFile&& dex_file) noexcept {
ext_dex_file_ = dex_file.ext_dex_file_;
dex_file.ext_dex_file_ = nullptr;
}