How can we call a func template instance using the Mars vendor already ?
user1234
user1234 at 12.de
Thu Feb 19 16:43:04 UTC 2026
On Thursday, 19 February 2026 at 16:30:04 UTC, monkyyy wrote:
> On Thursday, 19 February 2026 at 16:20:58 UTC, user1234 wrote:
>> On Thursday, 19 February 2026 at 15:37:42 UTC, user1234 wrote:
>>> [...]
>>> so you'll get
>>>
>>>> Error: function `runnable.NG` label
>>>> `_D8runnable__T2ngVii1ZQiFNaNbNiNfZi` is undefined
>>>> Error: function `runnable.NG` label
>>>> `_D8runnable__T7ngVii2ZQnFNaNbNiNfZi` is undefined
>>>
>>> So to keep things simples the idea is to provide a valid
>>> function identifier in the asm. I've used compiler explorer
>>> to get the __valid__ mangled version
>>> (https://godbolt.org/z/WYMqMhnWG). No luck.
>>>
>>> Is that even possible ?
>>
>> The static foreach does not seem to generate the symbols in a
>> classic way tho...
>>
>>> assume CS:.text._D8runnable__T2ngVii1ZQiFNaNbNiNfZi
>>
>> but on the other hand the error message is not a linker one
>
> nah its the asm block not having access to templates
That is not the problem. Here we accept that inline assemby is
"lazily handled", so you cannot mix pure (in the sense of high
level) D language with asm. The problem is really that the
function identifier should be ignored until the linking phase.
Remember that we have generated the right name using "compiler
explorer".
More information about the Digitalmars-d-learn
mailing list