D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19542 - Forward reference segfault with string namespace C++ syntax
Summary: Forward reference segfault with string namespace C++ syntax
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: C++, ice, pull
Depends on:
Blocks:
 
Reported: 2019-01-03 05:15 UTC by Mathias LANG
Modified: 2020-03-21 03:56 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 Mathias LANG 2019-01-03 05:15:40 UTC
```
pragma(msg, func!(int).mangleof);

extern(C++, `bar`)
{
    void func(T)();
}
```

SEGV with DMD64 D Compiler v2.084.0-170-g16cf015ec
Moving `pragma` after the declaration, or using the non-string syntax does not.
Comment 1 Dlang Bot 2020-01-16 12:53:07 UTC
@Geod24 created dlang/dmd pull request #10729 "Fix issue 19542:  Forward reference segfault with string namespace C++ syntax" fixing this issue:

- Fix issue 19542:  Forward reference segfault with string namespace C++ syntax
  
  This segfaulted for some constructs, such as `pragma(msg)` and `enum`,
  but not others, such as `static assert`, hence why the value isn't checked.

https://github.com/dlang/dmd/pull/10729
Comment 2 Dlang Bot 2020-01-16 18:31:03 UTC
dlang/dmd pull request #10729 "Fix issue 19542:  Forward reference segfault with string namespace C++ syntax" was merged into stable:

- cc9f2d46deff94ea9e553d6b79c6206a3c6a8b6f by Geod24:
  Fix issue 19542:  Forward reference segfault with string namespace C++ syntax
  
  This segfaulted for some constructs, such as `pragma(msg)` and `enum`,
  but not others, such as `static assert`, hence why the value isn't checked.

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