[Issue 22737] Segmentation fault in CppMangleVisitor.getTiNamespace
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Dec 27 12:11:30 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22737
--- Comment #4 from Tim <tim.dlang at t-online.de> ---
In my original code this happened for a utility function, which did not come
from C++. I used extern(C++): for the whole file, so the utility function also
got it, but I have solve it by making this function extern(D).
The following code should be equivalent C++:
==================================================
template <class T>
using Identity = T;
template <class T>
Identity<T> identity(T val)
{
return Identity<T>(val);
}
int main()
{
int x = identity(5);
return 0;
}
==================================================
Making this issue accepts-invalid would also work for me, because templates
with alias can probably just be marked as extern(D).
--
More information about the Digitalmars-d-bugs
mailing list