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

Fix Issue 17489 - ICE in ddmd/argtypes.d #6894

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ddmd/argtypes.d
Expand Up @@ -341,6 +341,8 @@ extern (C++) TypeTuple toArgTypes(Type t)
{
VarDeclaration f = t.sym.fields[i];
//printf(" [%d] %s f.type = %s\n", cast(int)i, f.toChars(), f.type.toChars());
if (f.type.ty == Terror)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, here is not the right place to check errors in one of the fields, should happen when semantic for the fields runs in finalizeSize or so.

goto Lmemory;
TypeTuple tup = toArgTypes(f.type);
if (!tup)
goto Lmemory;
Expand Down
11 changes: 11 additions & 0 deletions test/fail_compilation/extra-files/fail17489_file.d
@@ -0,0 +1,11 @@
struct Path {
immutable()m_nodes;
}

enum DirectoryChangeType {}


struct DirectoryChange {
DirectoryChangeType type;
Path path;
}
12 changes: 12 additions & 0 deletions test/fail_compilation/fail17489.d
@@ -0,0 +1,12 @@
// REQUIRED_ARGS: -Ifail_compilation/extra-files
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If EXTRA_SOURCES is used, this ICE doesn't appear.

// PERMUTE_ARGS:
/*
TEST_OUTPUT:
---
fail_compilation/extra-files/fail17489_file.d(2): Error: basic type expected, not )
fail_compilation/extra-files/fail17489_file.d(5): Error: enum fail17489_file.DirectoryChangeType enum `DirectoryChangeType` must have at least one member
---
*/
class VibedScheduler {
import fail17489_file;
}