Fix google-explicit-constructor warnings in vulkan.
* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1
Change-Id: I13c32bd5bc53fe897df58eda331ff70ebcf0b349
diff --git a/vulkan/libvulkan/debug_report.h b/vulkan/libvulkan/debug_report.h
index be9b645..3d8bd50 100644
--- a/vulkan/libvulkan/debug_report.h
+++ b/vulkan/libvulkan/debug_report.h
@@ -85,9 +85,9 @@
class DebugReportLogger {
public:
- DebugReportLogger(const VkInstanceCreateInfo& info)
+ explicit DebugReportLogger(const VkInstanceCreateInfo& info)
: instance_pnext_(info.pNext), callbacks_(nullptr) {}
- DebugReportLogger(const DebugReportCallbackList& callbacks)
+ explicit DebugReportLogger(const DebugReportCallbackList& callbacks)
: instance_pnext_(nullptr), callbacks_(&callbacks) {}
void Message(VkDebugReportFlagsEXT flags,
diff --git a/vulkan/libvulkan/driver.h b/vulkan/libvulkan/driver.h
index a02ebd7..a1612c7 100644
--- a/vulkan/libvulkan/driver.h
+++ b/vulkan/libvulkan/driver.h
@@ -61,7 +61,7 @@
VK_DEFINE_HANDLE(DeviceDispatchable)
struct InstanceData {
- InstanceData(const VkAllocationCallbacks& alloc)
+ explicit InstanceData(const VkAllocationCallbacks& alloc)
: opaque_api_data(),
allocator(alloc),
driver(),
diff --git a/vulkan/libvulkan/layers_extensions.h b/vulkan/libvulkan/layers_extensions.h
index 79fe59d..07ac1a3 100644
--- a/vulkan/libvulkan/layers_extensions.h
+++ b/vulkan/libvulkan/layers_extensions.h
@@ -26,7 +26,7 @@
class LayerRef {
public:
- LayerRef(const Layer* layer);
+ explicit LayerRef(const Layer* layer);
LayerRef(LayerRef&& other);
~LayerRef();
LayerRef(const LayerRef&) = delete;