Bug 13693 – Assertion failed at cppmangle.c:298: void CppMangleVisitor::mangle_variable(VarDeclaration*, bool)
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-11-07T01:47:54Z
Last change time
2018-02-22T13:59:38Z
Keywords
C++, ice
Assigned to
No Owner
Creator
Paul O'Neil
Comments
Comment #0 by redballoon36 — 2014-11-07T01:47:54Z
The following test case fails an assertion and crashes dmd:
extern(C++) struct A;
extern(C++) A *a;
dmd properly emits an error message explaining that this is not permitted (test.d(2): Error: variable test.a ICE: C++ static non- __gshared non-extern variables not supported). Then it reaches an assertion, fails, and dumps core.
I'm running dmd 2.066.1 on Arch Linux.
Comment #1 by hsteoh — 2014-11-07T06:18:29Z
ICEs are major issues.
Comment #2 by luis — 2015-08-31T08:01:30Z
This also causes problems:
struct Foo
{
extern (C++) static int foo;
}
Comment #3 by razvan.nitu1305 — 2018-02-22T13:59:38Z
Running the examples in comment 1 and 3 on git HEAD Ubuntu 16.04 results in the error specified in comment 1. Looks like the assert is not hit anymore and this looks like the correct behavior. Closing as fixed, please reopen is I am missing something