www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23803] New: Link error instead of error message when using

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

          Issue ID: 23803
           Summary: Link error instead of error message when using betterC
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: razvan.nitu1305 gmail.com

This could should error stating that `a~b` is not allowed in betterC

string foo()()
{
    string a, b;
    return a ~ b;
}

extern(C) void main()
{
    foo();
}

However, it gives a linker error because the compiler chooses to simply not
emit the functions that use the GC when using the -betterC switch.

--
Mar 23 2023