diff --git a/src/inspector/inspector_test.cc b/src/inspector/inspector_test.cc index 91e69800da..dbdaf934f8 100644 --- a/src/inspector/inspector_test.cc +++ b/src/inspector/inspector_test.cc @@ -184,52 +184,38 @@ class InspectorHelper { dvar->set_decorations(std::move(decos)); if (val) { dvar->set_constructor(std::make_unique( - MakeLiteral(type, val))); + MakeLiteral(type, val))); } mod()->AddGlobalVariable(std::move(dvar)); } - /// Generates an ast::Literal for the given value - /// @tparam T C++ type of the literal, must agree with type - /// @returns a Literal of the expected type and value - template - std::unique_ptr MakeLiteral(ast::type::Type*, T*) { - return nullptr; - } - /// @param type AST type of the literal, must resolve to BoolLiteral /// @param val scalar value for the literal to contain /// @returns a Literal of the expected type and value - template <> - std::unique_ptr MakeLiteral(ast::type::Type* type, - bool* val) { + std::unique_ptr MakeLiteral(ast::type::Type* type, bool* val) { return std::make_unique(type, *val); } /// @param type AST type of the literal, must resolve to UIntLiteral /// @param val scalar value for the literal to contain /// @returns a Literal of the expected type and value - template <> - std::unique_ptr MakeLiteral(ast::type::Type* type, - uint32_t* val) { + std::unique_ptr MakeLiteral(ast::type::Type* type, + uint32_t* val) { return std::make_unique(type, *val); } /// @param type AST type of the literal, must resolve to IntLiteral /// @param val scalar value for the literal to contain /// @returns a Literal of the expected type and value - template <> - std::unique_ptr MakeLiteral(ast::type::Type* type, - int32_t* val) { + std::unique_ptr MakeLiteral(ast::type::Type* type, + int32_t* val) { return std::make_unique(type, *val); } /// @param type AST type of the literal, must resolve to FloattLiteral /// @param val scalar value for the literal to contain /// @returns a Literal of the expected type and value - template <> - std::unique_ptr MakeLiteral(ast::type::Type* type, - float* val) { + std::unique_ptr MakeLiteral(ast::type::Type* type, float* val) { return std::make_unique(type, *val); }