D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19717 - case of segfault due to undetected forward reference
Summary: case of segfault due to undetected forward reference
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: ice, pull
Depends on:
Blocks:
 
Reported: 2019-03-03 23:50 UTC by elpenguino+D
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 elpenguino+D 2019-03-03 23:50:27 UTC
Reduced code:
```
enum bar = __traits(getMember, mixin(__MODULE__), "foo");

auto foo() {
	return foo();
}

void foo(Foo) {}
```
This also prints a misleading error: `Error: cannot overload both property and non-property functions`

The error appears to have been introduced after DMD 2.070.2.
Comment 1 basile-z 2019-03-04 06:51:31 UTC
That's a forward ref not detected. If you put the enum decl after foo() overloads it exits with a normal program error.
Comment 2 Dlang Bot 2019-03-04 07:05:11 UTC
@Basile-z created dlang/dmd pull request #9412 "fix issue 19717 -  case of segfault due to undetected forward reference" fixing this issue:

- fix issue 19717 -  case of segfault due to undetected forward reference

https://github.com/dlang/dmd/pull/9412
Comment 3 Dlang Bot 2019-03-04 09:14:28 UTC
dlang/dmd pull request #9412 "fix issue 19717 -  case of segfault due to undetected forward reference" was merged into master:

- d621072ebdea4701b179dacb267f5876ad55c734 by Basile Burg:
  fix issue 19717 -  case of segfault due to undetected forward reference

https://github.com/dlang/dmd/pull/9412
Comment 4 Dlang Bot 2019-06-16 20:57:34 UTC
dlang/dmd pull request #10046 "[dmd-cxx] Backport semanticRun refactoring and recursive semantic SEGV bug fixes" was merged into dmd-cxx:

- 9ef5e9ba496a0c07500c78f09464b47b07e57e8a by Basile Burg:
  fix issue 19717 -  case of segfault due to undetected forward reference

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