Merge "Fix/suppress aapt/aapt2 google-explicit-constructor warnings"

am: cdf6be573f

Change-Id: I4fbcbdd7e845f2ce7106a85ce8224c17517db1f5
This commit is contained in:
Chih-Hung Hsieh
2019-01-04 11:55:42 -08:00
committed by android-build-merger
10 changed files with 19 additions and 15 deletions

View File

@@ -29,7 +29,7 @@ struct ConfigDescription : public android::ResTable_config {
size = sizeof(android::ResTable_config);
}
ConfigDescription(const android::ResTable_config&o) { // NOLINT(implicit)
ConfigDescription(const android::ResTable_config&o) { // NOLINT(google-explicit-constructor)
*static_cast<android::ResTable_config*>(this) = o;
size = sizeof(android::ResTable_config);
}

View File

@@ -414,7 +414,7 @@ class XmlPrinter : public xml::ConstVisitor {
public:
using xml::ConstVisitor::Visit;
XmlPrinter(Printer* printer) : printer_(printer) {
explicit XmlPrinter(Printer* printer) : printer_(printer) {
}
void Visit(const xml::Element* el) override {

View File

@@ -108,7 +108,7 @@ struct ResourceNameRef {
ResourceNameRef() = default;
ResourceNameRef(const ResourceNameRef&) = default;
ResourceNameRef(ResourceNameRef&&) = default;
ResourceNameRef(const ResourceName& rhs); // NOLINT(implicit)
ResourceNameRef(const ResourceName& rhs); // NOLINT(google-explicit-constructor)
ResourceNameRef(const android::StringPiece& p, ResourceType t, const android::StringPiece& e);
ResourceNameRef& operator=(const ResourceNameRef& rhs) = default;
ResourceNameRef& operator=(ResourceNameRef&& rhs) = default;
@@ -139,7 +139,7 @@ struct ResourceId {
ResourceId();
ResourceId(const ResourceId& rhs);
ResourceId(uint32_t res_id); // NOLINT(implicit)
ResourceId(uint32_t res_id); // NOLINT(google-explicit-constructor)
ResourceId(uint8_t p, uint8_t t, uint16_t e);
bool is_valid() const;

View File

@@ -645,7 +645,7 @@ static bool CompileFile(IAaptContext* context, const CompileOptions& options,
class CompileContext : public IAaptContext {
public:
CompileContext(IDiagnostics* diagnostics) : diagnostics_(diagnostics) {
explicit CompileContext(IDiagnostics* diagnostics) : diagnostics_(diagnostics) {
}
PackageType GetPackageType() override {

View File

@@ -141,7 +141,7 @@ struct LinkOptions {
class LinkContext : public IAaptContext {
public:
LinkContext(IDiagnostics* diagnostics)
explicit LinkContext(IDiagnostics* diagnostics)
: diagnostics_(diagnostics), name_mangler_({}), symbols_(&name_mangler_) {
}
@@ -226,7 +226,7 @@ class LinkContext : public IAaptContext {
// See b/37498913.
class FeatureSplitSymbolTableDelegate : public DefaultSymbolTableDelegate {
public:
FeatureSplitSymbolTableDelegate(IAaptContext* context) : context_(context) {
explicit FeatureSplitSymbolTableDelegate(IAaptContext* context) : context_(context) {
}
virtual ~FeatureSplitSymbolTableDelegate() = default;

View File

@@ -44,7 +44,7 @@ class KeepSet {
public:
KeepSet() = default;
KeepSet(bool conditional_keep_rules) : conditional_keep_rules_(conditional_keep_rules) {
explicit KeepSet(bool conditional_keep_rules) : conditional_keep_rules_(conditional_keep_rules) {
}
inline void AddManifestClass(const UsageLocation& file, const std::string& class_name) {

View File

@@ -55,7 +55,7 @@ class XmlCompatVersioner {
public:
using Rules = std::unordered_map<ResourceId, std::unique_ptr<IDegradeRule>>;
XmlCompatVersioner(const Rules* rules);
explicit XmlCompatVersioner(const Rules* rules);
std::vector<std::unique_ptr<xml::XmlResource>> Process(IAaptContext* context,
xml::XmlResource* doc,
@@ -83,7 +83,7 @@ struct ReplacementAttr {
class DegradeToManyRule : public IDegradeRule {
public:
DegradeToManyRule(std::vector<ReplacementAttr> attrs);
explicit DegradeToManyRule(std::vector<ReplacementAttr> attrs);
virtual ~DegradeToManyRule() = default;
std::vector<DegradeResult> Degrade(const xml::Element& src_el, const xml::Attribute& src_attr,

View File

@@ -71,7 +71,7 @@ class SymbolTable {
bool is_dynamic = false;
};
SymbolTable(NameMangler* mangler);
explicit SymbolTable(NameMangler* mangler);
// Overrides the default ISymbolTableDelegate, which allows a custom defined strategy for
// looking up resources from a set of sources.

View File

@@ -173,10 +173,12 @@ class ValueEqImpl : public ::testing::MatcherInterface<T> {
template <typename TValue>
class ValueEqMatcher {
public:
// NOLINTNEXTLINE(google-explicit-constructor)
ValueEqMatcher(TValue expected) : expected_(std::move(expected)) {
}
template <typename T>
// NOLINTNEXTLINE(google-explicit-constructor)
operator ::testing::Matcher<T>() const {
return ::testing::Matcher<T>(new ValueEqImpl<T>(&expected_));
}
@@ -188,10 +190,12 @@ class ValueEqMatcher {
template <typename TValue>
class ValueEqPointerMatcher {
public:
// NOLINTNEXTLINE(google-explicit-constructor)
ValueEqPointerMatcher(const TValue* expected) : expected_(expected) {
}
template <typename T>
// NOLINTNEXTLINE(google-explicit-constructor)
operator ::testing::Matcher<T>() const {
return ::testing::Matcher<T>(new ValueEqImpl<T>(expected_));
}

View File

@@ -44,12 +44,12 @@ class Maybe {
Maybe(const Maybe& rhs);
template <typename U>
Maybe(const Maybe<U>& rhs); // NOLINT(implicit)
Maybe(const Maybe<U>& rhs); // NOLINT(google-explicit-constructor)
Maybe(Maybe&& rhs) noexcept;
template <typename U>
Maybe(Maybe<U>&& rhs); // NOLINT(implicit)
Maybe(Maybe<U>&& rhs); // NOLINT(google-explicit-constructor)
Maybe& operator=(const Maybe& rhs);
@@ -64,12 +64,12 @@ class Maybe {
/**
* Construct a Maybe holding a value.
*/
Maybe(const T& value); // NOLINT(implicit)
Maybe(const T& value); // NOLINT(google-explicit-constructor)
/**
* Construct a Maybe holding a value.
*/
Maybe(T&& value); // NOLINT(implicit)
Maybe(T&& value); // NOLINT(google-explicit-constructor)
/**
* True if this holds a value, false if