diff --git a/oi/CodeGen.cpp b/oi/CodeGen.cpp index 9614a1f..72631dd 100644 --- a/oi/CodeGen.cpp +++ b/oi/CodeGen.cpp @@ -1060,7 +1060,7 @@ void addStandardTypeHandlers(TypeGraph& typeGraph, getSizeType(Ctx& ctx, const T &t, typename TypeHandler::type returnArg) { JLOG("obj @"); JLOGPTR(&t); - return TypeHandler::getSizeType(ctx, t, returnArg); + return TypeHandler>::getSizeType(ctx, t, returnArg); } )"; @@ -1072,9 +1072,9 @@ constexpr inst::Field make_field(std::string_view name) { sizeof(T), ExclusiveSizeProvider::size, name, - NameProvider::names, - TypeHandler::fields, - TypeHandler::processors, + NameProvider>::names, + TypeHandler>::fields, + TypeHandler>::processors, }; } )"; diff --git a/test/integration/std_smart_ptr.toml b/test/integration/std_smart_ptr.toml index 8fc66bf..e14e398 100644 --- a/test/integration/std_smart_ptr.toml +++ b/test/integration/std_smart_ptr.toml @@ -31,6 +31,31 @@ definitions = ''' } ] ''' + [cases.unique_ptr_const_uint64_empty] + param_types = ["std::unique_ptr&"] + setup = "return {nullptr};" + expect_json = ''' + [ + { + "staticSize": 8, + "dynamicSize": 0, + "exclusiveSize": 8, + "length": 0, + "capacity": 1, + "elementStaticSize": 8 + } + ] + ''' + expect_json_v2 = ''' + [ + { + "staticSize": 8, + "exclusiveSize": 8, + "length": 0, + "capacity": 1 + } + ] + ''' [cases.unique_ptr_uint64_present] param_types = ["std::unique_ptr&"] setup = "return {std::make_unique(64)};" @@ -79,6 +104,30 @@ definitions = ''' } ] ''' + [cases.unique_ptr_const_vector_empty] + param_types = ["std::unique_ptr>&"] + setup = "return {nullptr};" + expect_json = ''' + [ + { + "staticSize": 8, + "dynamicSize": 0, + "length": 0, + "capacity": 1, + "elementStaticSize": 24 + } + ] + ''' + expect_json_v2 = ''' + [ + { + "staticSize": 8, + "exclusiveSize": 8, + "length": 0, + "capacity": 1 + } + ] + ''' [cases.unique_ptr_vector_present] param_types = ["std::unique_ptr>&"] setup = "return {std::make_unique>(std::initializer_list({1,2,3,4,5}))};" @@ -181,6 +230,30 @@ definitions = ''' } ] ''' + [cases.shared_ptr_const_uint64_empty] + param_types = ["std::shared_ptr&"] + setup = "return {nullptr};" + expect_json = ''' + [ + { + "staticSize": 16, + "dynamicSize": 0, + "length": 0, + "capacity": 1, + "elementStaticSize": 8 + } + ] + ''' + expect_json_v2 = ''' + [ + { + "staticSize": 16, + "exclusiveSize": 16, + "length": 0, + "capacity": 1 + } + ] + ''' [cases.shared_ptr_uint64_present] param_types = ["std::shared_ptr&"] setup = "return std::make_shared(64);" @@ -232,6 +305,30 @@ definitions = ''' } ] ''' + [cases.shared_ptr_const_vector_empty] + param_types = ["std::shared_ptr>&"] + setup = "return {nullptr};" + expect_json = ''' + [ + { + "staticSize": 16, + "dynamicSize": 0, + "length": 0, + "capacity": 1, + "elementStaticSize": 24 + } + ] + ''' + expect_json_v2 = ''' + [ + { + "staticSize": 16, + "exclusiveSize": 16, + "length": 0, + "capacity": 1 + } + ] + ''' [cases.shared_ptr_vector_present] param_types = ["std::shared_ptr>&"] setup = "return std::make_shared>(std::initializer_list({1,2,3,4,5}));" diff --git a/types/shrd_ptr_type.toml b/types/shrd_ptr_type.toml index bb3a622..a7095ce 100644 --- a/types/shrd_ptr_type.toml +++ b/types/shrd_ptr_type.toml @@ -60,7 +60,7 @@ el.pointer = std::get(d.val).value; type = """ types::st::Sum, - typename TypeHandler::type> + typename TypeHandler>::type> """ func = """ #ifdef __GLIBCXX__ diff --git a/types/uniq_ptr_type.toml b/types/uniq_ptr_type.toml index f723f80..68d20e7 100644 --- a/types/uniq_ptr_type.toml +++ b/types/uniq_ptr_type.toml @@ -61,7 +61,7 @@ el.pointer = std::get(d.val).value; type = """ types::st::Sum, - typename TypeHandler::type> + typename TypeHandler>::type> """ func = """ auto sum = std::get(d.val);