From 81aff0fbabf72354f635b07c714d5dedaa9a1419 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Thu, 20 Dec 2018 13:53:28 -0800 Subject: [PATCH] Fix/suppress startop google-explicit-constructor warnings * Add explicit to conversion constructors/operators Bug: 28341362 Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor Change-Id: I9e7b929cfa65c68f4cdb4710c1c5c6760d56e4d5 --- startop/view_compiler/dex_builder.h | 4 ++-- startop/view_compiler/main.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/startop/view_compiler/dex_builder.h b/startop/view_compiler/dex_builder.h index 06059c8c6e568..757d863461f0c 100644 --- a/startop/view_compiler/dex_builder.h +++ b/startop/view_compiler/dex_builder.h @@ -73,7 +73,7 @@ class TypeDescriptor { bool operator<(const TypeDescriptor& rhs) const { return descriptor_ < rhs.descriptor_; } private: - TypeDescriptor(std::string descriptor) : descriptor_{descriptor} {} + explicit TypeDescriptor(std::string descriptor) : descriptor_{descriptor} {} const std::string descriptor_; }; @@ -83,7 +83,7 @@ class TypeDescriptor { class Prototype { public: template - Prototype(TypeDescriptor return_type, TypeDescriptors... param_types) + explicit Prototype(TypeDescriptor return_type, TypeDescriptors... param_types) : return_type_{return_type}, param_types_{param_types...} {} // Encode this prototype into the dex file. diff --git a/startop/view_compiler/main.cc b/startop/view_compiler/main.cc index 9351dc34ea547..55bfdc78ec1bf 100644 --- a/startop/view_compiler/main.cc +++ b/startop/view_compiler/main.cc @@ -42,7 +42,7 @@ DEFINE_string(package, "", "The package name for the generated class (required)" class ViewCompilerXmlVisitor : public XMLVisitor { public: - ViewCompilerXmlVisitor(JavaLangViewBuilder* builder) : builder_(builder) {} + explicit ViewCompilerXmlVisitor(JavaLangViewBuilder* builder) : builder_(builder) {} bool VisitEnter(const XMLDocument& /*doc*/) override { builder_->Start();