diff options
| author | 2023-09-07 22:30:13 +0000 | |
|---|---|---|
| committer | 2023-09-07 22:30:13 +0000 | |
| commit | fc08c2d03603cb7b8ff3d80802ffecedf80b263a (patch) | |
| tree | 0fd83297e4dbcb3f89e69fddeb28499dfd289e20 | |
| parent | 90cd1955cabce51a9562f38cb668f13f98825f0e (diff) | |
| parent | c3e32935494798aa5b7b2a557b29275e21240b02 (diff) | |
Merge "[RESTRICT AUTOMERGE] Fix std::unique_ptr error with incomplete CommonFeatureGroup" into main
| -rw-r--r-- | tools/aapt2/dump/DumpManifest.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/aapt2/dump/DumpManifest.cpp b/tools/aapt2/dump/DumpManifest.cpp index 9828b97982ed..f93949bab341 100644 --- a/tools/aapt2/dump/DumpManifest.cpp +++ b/tools/aapt2/dump/DumpManifest.cpp @@ -116,9 +116,7 @@ class CommonFeatureGroup; class ManifestExtractor { public: - - explicit ManifestExtractor(LoadedApk* apk, DumpManifestOptions& options) - : apk_(apk), options_(options) { } + explicit ManifestExtractor(LoadedApk* apk, DumpManifestOptions& options); class Element { public: @@ -387,7 +385,7 @@ class ManifestExtractor { DumpManifestOptions& options_; private: - std::unique_ptr<CommonFeatureGroup> commonFeatureGroup_ = util::make_unique<CommonFeatureGroup>(); + std::unique_ptr<CommonFeatureGroup> commonFeatureGroup_; std::map<std::string, ConfigDescription> locales_; std::map<uint16_t, ConfigDescription> densities_; std::vector<Element*> parent_stack_; @@ -1970,6 +1968,12 @@ static void Print(ManifestExtractor::Element* el, text::Printer* printer) { } } +// Define this constructor after the CommonFeatureGroup class definition to avoid errors with using +// std::unique_ptr on an incomplete type. +ManifestExtractor::ManifestExtractor(LoadedApk* apk, DumpManifestOptions& options) + : apk_(apk), options_(options), commonFeatureGroup_(util::make_unique<CommonFeatureGroup>()) { +} + bool ManifestExtractor::Dump(text::Printer* printer, IDiagnostics* diag) { // Load the manifest std::unique_ptr<xml::XmlResource> doc = apk_->LoadXml("AndroidManifest.xml", diag); |