Issue 23803 - Link error instead of error message when using betterC
Summary: Link error instead of error message when using betterC
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2023-03-23 09:54 UTC by RazvanN
Modified: 2024-12-07 16:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description RazvanN 2023-03-23 09:54:08 UTC
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.
Comment 1 Dlang Bot 2024-12-07 16:43:26 UTC
@royalpinto007 created dlang/dmd pull request #17492 "fix Bugzilla 23803 - compile-time error for concatenation in -betterC" fixing this issue:

- fix Bugzilla 23803 - compile-time error for concatenation in -betterC
  
  Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

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