D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15406 - [ICE] Accessing member of namespace embedded in a struct causes segfault
Summary: [ICE] Accessing member of namespace embedded in a struct causes segfault
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2015-12-05 00:14 UTC by Meta
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Meta 2015-12-05 00:14:10 UTC
The following program causes the compiler to segfault. It compiles successfully if `Test.Name.Space.test` is not accessed.

struct Test
{
	extern(C++, Name.Space)
	{
		enum test = 0;
	}
}

void main()
{
	assert(Test.Name.Space.test == 0);
}
Comment 1 ZombineDev 2015-12-05 10:31:56 UTC
I think it segfaults because there's no concept of standalone enum values in C++ and the compiler does not now what to do.

I would guess that you have hit some of the "Internal Compiler Error"s in https://github.com/D-Programming-Language/dmd/blob/master/src/cppmangle.d
Comment 2 basile-z 2019-02-28 17:51:08 UTC
Just a regular error nowadays