Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE extern(C++) static #929

Closed
TurkeyMan opened this issue May 8, 2015 · 5 comments
Closed

ICE extern(C++) static #929

TurkeyMan opened this issue May 8, 2015 · 5 comments

Comments

@TurkeyMan
Copy link

Another ICE

1>d\ud\pointcloud\pointcloudformat.d(112): Error: variable x ICE: C++ static non- __gshared non-extern variables not supported
1>Assertion failed: 0, file D:\OpenSource\ldc\ldc-release\dmd2\cppmangle.c, line 298

Given:

extern(C++):
 static immutable(int)[4] x;

What's strange is, there are reasonable error messages being emitted... but the compiler still asserts and pops up a crash dialog.

@redstar
Copy link
Member

redstar commented May 31, 2015

This is an upstream/frontend problem. The mangler emits the error message and then dies:

    if (!(d->storage_class & (STCextern | STCgshared)))
    {
        d->error("Internal Compiler Error: C++ static non- __gshared non-extern variables not supported");
        assert(0);
    }

@TurkeyMan
Copy link
Author

Perhaps it's the implementation of d->error() is different for LDC?
I seem to get a lot of errors in crash/ICE pop-up dialog boxes from LDC, and modal dialog boxes in windows interrupt the build process. I have never seen the same thing from DMD, and not with the exact same code as I've been reporting here.

@yebblies
Copy link

yebblies commented Jun 1, 2015

It's not ->error(), it's the assert that comes right after it. These ICEs are because these types are not handled by the C++ mangler, and they should have already been rejected during semantic.

@dnadlinger
Copy link
Member

These errors do not crash the compiler any longer. To actually add support for further parts of C++, the changes should go into the upstream frontend first.

@kinke
Copy link
Member

kinke commented Aug 20, 2016

Yep, no crash, no dialog box anymore, just a regular error.

@kinke kinke closed this as completed Aug 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants