Thread overview
[Issue 18716] type const(char)[] can not be mapped to C++
[Issue 18716] [ICE] type const(char)[] can not be mapped to C++
Apr 03, 2018
Jacob Carlborg
Feb 23, 2020
Dlang Bot
Dec 17, 2022
Iain Buclaw
Dec 17, 2022
Iain Buclaw
Dec 17, 2022
Iain Buclaw
Jun 24, 2023
Nick Treleaven
Jun 24, 2023
Nick Treleaven
Jun 24, 2023
Nick Treleaven
April 03, 2018
https://issues.dlang.org/show_bug.cgi?id=18716

--- Comment #1 from Jacob Carlborg <doob@me.com> ---
Pull request: https://github.com/dlang/dmd/pull/8120.

--
February 23, 2020
https://issues.dlang.org/show_bug.cgi?id=18716

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@jacob-carlborg updated dlang/dmd pull request #8120 "Fix issue 18716: type `const(char)[]` can not be mapped to C++" fixing this issue:

- Fix issue 18716: type `const(char)[]` can not be mapped to C++

  D arrays don't have any corresponding type in C++. Instead we mangle
  it as a templated struct with the name `__dslice`, i.e.
  `struct __dslice(T)`, where `T` is the element type of the array. For
  an array of ints it would be mangled as the following type:
  `__dslice!int`.

https://github.com/dlang/dmd/pull/8120

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18716

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18716

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
           Severity|normal                      |critical

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18716

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice

--
June 24, 2023
https://issues.dlang.org/show_bug.cgi?id=18716

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #3 from Nick Treleaven <nick@geany.org> ---
Note that:

extern (C) void foo(const(char)[]) {}

and `dmd -HC` generates:

template<typename T>
struct _d_dynamicArray final
{
    size_t length;
    T *ptr;
    ...
};
...
extern "C" void foo(_d_dynamicArray< const char > __param_0_);


So hopefully this could happen for extern(C++) too.

--
June 24, 2023
https://issues.dlang.org/show_bug.cgi?id=18716

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[ICE] type const(char)[]    |type const(char)[] can not
                   |can not be mapped to C++    |be mapped to C++

--
June 24, 2023
https://issues.dlang.org/show_bug.cgi?id=18716

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=23971

--