summaryrefslogtreecommitdiff
path: root/tests/initializer-list/partial-init-diagnostic.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/initializer-list/partial-init-diagnostic.slang')
-rw-r--r--tests/initializer-list/partial-init-diagnostic.slang19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/initializer-list/partial-init-diagnostic.slang b/tests/initializer-list/partial-init-diagnostic.slang
new file mode 100644
index 000000000..ea3acb2c7
--- /dev/null
+++ b/tests/initializer-list/partial-init-diagnostic.slang
@@ -0,0 +1,19 @@
+//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
+
+struct PartialInit
+{
+ int x = 1;
+ int y;
+ // compiler synthesizes:
+ // __init(int x, int y);
+}
+
+void test()
+{
+ // TODO: Because we have a legacy logic that will always convert the one arugment ctor call to
+ // initializer list, and that initializer list will fall back to the legacy C-Style initialization.
+ // We need to remove that logic.
+
+ // CHECK: error 33070: expected a function, got 'typeof(PartialInit)'
+ PartialInit p = PartialInit(2); // error, no ctor match.
+}