changeset 1269:b8a51aa44d4c

Added testcase for overlapping struct default initializer I has missed. Slight tweak of the relevant error message.
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Mon, 27 Apr 2009 01:43:29 +0200
parents 4ae3b3ceea11
children dd135ff697fa
files ir/irtypestruct.cpp tests/mini/nocompile_initoverlap2.d
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ir/irtypestruct.cpp	Sun Apr 26 20:36:53 2009 +0200
+++ b/ir/irtypestruct.cpp	Mon Apr 27 01:43:29 2009 +0200
@@ -110,7 +110,7 @@
                     if (v_begin >= f_end || v_end <= f_begin)
                         continue;
 
-                    sd->error(vd->loc, "overlapping initialization for %s and %s",
+                    sd->error(vd->loc, "has overlapping initialization for %s and %s",
                         field_it->toChars(), vd->toChars());
                 }
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/mini/nocompile_initoverlap2.d	Mon Apr 27 01:43:29 2009 +0200
@@ -0,0 +1,8 @@
+struct S
+{
+    union
+    {
+        float f = 1;
+        int i = 2;
+    }
+}