Browse Source

Fix compiler errors in debug/c++20

pull/1892/head
duckdoom5 5 months ago
parent
commit
f0c8af0fa6
  1. 7
      include/CppSharp.h
  2. 3
      tests/dotnet/CSharp/CSharpTemplates.h
  3. 9
      tests/dotnet/NamespacesDerived/NamespacesDerived.h

7
include/CppSharp.h

@ -207,11 +207,12 @@ namespace clix { @@ -207,11 +207,12 @@ namespace clix {
typename detail::StringTypeSelector<encoding>::Type,
System::String ^
>::Type marshalString(SourceType string) {
constexpr detail::MarshalingDirection direction =
detail::IfManaged<SourceType>::Result ? detail::CxxFromNet : detail::NetFromCxx;
using StringMarshaler = detail::StringMarshaler<direction>;
// Pass on the call to our nifty template routines
return detail::StringMarshaler<
detail::IfManaged<SourceType>::Result ? detail::CxxFromNet : detail::NetFromCxx
>::marshal<encoding, SourceType>(string);
return StringMarshaler::template marshal<encoding, SourceType>(string);
}

3
tests/dotnet/CSharp/CSharpTemplates.h

@ -218,7 +218,8 @@ void Base<T>::Nested::f(const T& t) @@ -218,7 +218,8 @@ void Base<T>::Nested::f(const T& t)
template <typename T>
void Base<T>::invokeFriend()
{
f(Nested());
Nested n;
f(n);
}
template <typename T>

9
tests/dotnet/NamespacesDerived/NamespacesDerived.h

@ -101,7 +101,14 @@ template<typename T> @@ -101,7 +101,14 @@ template<typename T>
class CustomAllocator
{
public:
typedef T value_type;
using value_type = T;
using pointer_type = void*;
CustomAllocator() = default;
template <typename U>
CustomAllocator(const CustomAllocator<U>&) noexcept {
}
T* allocate(size_t cnt, const void* = 0) { return 0; }
void deallocate(T* p, size_t cnt) {}

Loading…
Cancel
Save