[Issue 22050] -betterC: TypeInfo in speculative template instantiation aborts compilation without error message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 20 19:19:16 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22050

moonlightsentinel at disroot.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |moonlightsentinel at disroot.o
                   |                            |rg
           Hardware|x86_64                      |All
            Summary|-betterC silent crash when  |-betterC: TypeInfo in
                   |compiling map returning     |speculative template
                   |string                      |instantiation aborts
                   |                            |compilation without error
                   |                            |message
                 OS|Linux                       |All

--- Comment #1 from moonlightsentinel at disroot.org ---
DMD  doesn't actually crash but aborts the compilation because of a hidden
error (TypeInfo used in dup). The error message is not printed because the
instantiation occurs in a speculative context.

Reduced example:

============================================
__gshared val = __traits(compiles, to!());

void to()()
{
    auto ti = typeid(char[]);
}
============================================

dmd -c -o- -betterC -verrors=spec test.d
(spec:1) test.d(6): Error: `TypeInfo` cannot be used with -betterC

--


More information about the Digitalmars-d-bugs mailing list