https://issues.dlang.org/show_bug.cgi?id=16631
Issue ID: 16631
Summary: Program crash when a version activates a method
defined in a static library
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: critical
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
A program crashes when it's linked with a static library and if a version
specification is used to activate the protected method of a class.
reproduction:
=== lib.d ===
module lib;
class Foo
{
protected void bug(){}
protected version(bug) void conditionalBug(){}
void test() {bug;}
}
=============
=== main.d ===
module main;
import lib;
void main()
{
(new Foo).test;
}
==============
=== test.sh ====
dmd lib.d -lib
dmd main.d lib.a -version=bug
./main
================
output:
./test.sh : ligne 3 : 3096 Erreur de segmentation ./main
This is caused by the front end because the same error appends with latest
stable LDC. Latest stable DMD is affected, latest beta too.
--