summaryrefslogtreecommitdiff
path: root/tools/aapt2
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2020-03-05 15:59:25 -0800
committerChih-Hung Hsieh <chh@google.com>2020-03-06 10:04:30 -0800
commit7a616f65d65e6ff124296520073bc31cc0ad8f87 (patch)
treee842046e6725376cdac2c8f48e61d83ebd8feb96 /tools/aapt2
parent335db814a5a1408b8715ab815c8151fc8eecb892 (diff)
Suppress bugprone-use-after-move warnings
Bug: 150783499 Test: WITH_TIDY=1 make Change-Id: Ifdd5d89d2207caba765e8f74e8a86f6b6b4ff609
Diffstat (limited to 'tools/aapt2')
-rw-r--r--tools/aapt2/ResourceParser.cpp3
-rw-r--r--tools/aapt2/util/BigBuffer_test.cpp2
-rw-r--r--tools/aapt2/xml/XmlDom.cpp2
3 files changed, 6 insertions, 1 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp
index 40eae545c06b..b34c3d59d6a5 100644
--- a/tools/aapt2/ResourceParser.cpp
+++ b/tools/aapt2/ResourceParser.cpp
@@ -445,6 +445,7 @@ bool ResourceParser::ParseResources(xml::XmlPullParser* parser) {
ParsedResource parsed_resource;
parsed_resource.config = config_;
parsed_resource.source = source_.WithLine(parser->line_number());
+ // NOLINTNEXTLINE(bugprone-use-after-move) move+reset comment
parsed_resource.comment = std::move(comment);
if (options_.visibility) {
parsed_resource.visibility_level = options_.visibility.value();
@@ -977,6 +978,7 @@ bool ResourceParser::ParsePublicGroup(xml::XmlPullParser* parser, ParsedResource
child_resource.name.type = *parsed_type;
child_resource.name.entry = maybe_name.value().to_string();
child_resource.id = next_id;
+ // NOLINTNEXTLINE(bugprone-use-after-move) move+reset comment
child_resource.comment = std::move(comment);
child_resource.source = item_source;
child_resource.visibility_level = Visibility::Level::kPublic;
@@ -1703,6 +1705,7 @@ bool ResourceParser::ParseDeclareStyleable(xml::XmlPullParser* parser,
ParsedResource child_resource;
child_resource.name = child_ref.name.value();
child_resource.source = item_source;
+ // NOLINTNEXTLINE(bugprone-use-after-move) move+reset comment
child_resource.comment = std::move(comment);
if (options_.visibility) {
child_resource.visibility_level = options_.visibility.value();
diff --git a/tools/aapt2/util/BigBuffer_test.cpp b/tools/aapt2/util/BigBuffer_test.cpp
index a7776e33ae74..64dcc1dad9a2 100644
--- a/tools/aapt2/util/BigBuffer_test.cpp
+++ b/tools/aapt2/util/BigBuffer_test.cpp
@@ -62,7 +62,7 @@ TEST(BigBufferTest, AppendAndMoveBlock) {
*b1 = 44;
buffer.AppendBuffer(std::move(buffer2));
- EXPECT_EQ(0u, buffer2.size());
+ EXPECT_EQ(0u, buffer2.size()); // NOLINT
EXPECT_EQ(buffer2.begin(), buffer2.end());
}
diff --git a/tools/aapt2/xml/XmlDom.cpp b/tools/aapt2/xml/XmlDom.cpp
index 9a725fad8727..005eeb936612 100644
--- a/tools/aapt2/xml/XmlDom.cpp
+++ b/tools/aapt2/xml/XmlDom.cpp
@@ -305,6 +305,8 @@ std::unique_ptr<XmlResource> Inflate(const void* data, size_t len, std::string*
if (pending_element == nullptr) {
pending_element = util::make_unique<Element>();
}
+ // pending_element is not nullptr
+ // NOLINTNEXTLINE(bugprone-use-after-move)
pending_element->namespace_decls.push_back(std::move(decl));
break;
}