mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

* Fix error when struct initializer isn't accepted * Rename StructDeclaration.hasRegularCtor parameter to ignoreDisabled checkDisabled detected disabled ctors when it was false, which was confusing! * Update tests
17 lines
427 B
D
17 lines
427 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail336.d(17): Error: Cannot use struct initializer syntax for struct `S` because it has a constructor
|
|
fail_compilation/fail336.d(17): Use `S( arguments )` instead of `{ initializers }`
|
|
---
|
|
*/
|
|
|
|
// https://issues.dlang.org/show_bug.cgi?id=3476
|
|
// C-style initializer for structs must be disallowed for structs with a constructor
|
|
struct S
|
|
{
|
|
int a;
|
|
this(int) {}
|
|
}
|
|
|
|
S s = { 1 };
|