changeset 1492:1327a7ff1be6

[Issue 902] Duplicate zero-initialized template member variables Frits van Bommel <fvbommel@wxs.nl> 2007-01-29 http://d.puremagic.com/issues/show_bug.cgi?id=902
author thomask
date Mon, 23 Apr 2007 17:52:27 +0000
parents c1943ae1abbf
children 1d830b6d7f62
files complex/template_60/a.d complex/template_60/b.d complex/template_60/complex.mak
diffstat 3 files changed, 93 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/complex/template_60/a.d	Mon Apr 23 17:52:27 2007 +0000
@@ -0,0 +1,16 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Frits van Bommel <fvbommel@wxs.nl>
+// @date@	2007-01-29
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=902
+// @desc@	[Issue 902] Duplicate zero-initialized template member variables
+
+template Foo(T) {
+	const uint[1] Foo = 0;
+}
+
+uint[] foo() {
+	return Foo!(void);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/complex/template_60/b.d	Mon Apr 23 17:52:27 2007 +0000
@@ -0,0 +1,14 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Frits van Bommel <fvbommel@wxs.nl>
+// @date@	2007-01-29
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=902
+// @desc@	[Issue 902] Duplicate zero-initialized template member variables
+
+import a;
+
+void main(){
+	auto b = Foo!(void);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/complex/template_60/complex.mak	Mon Apr 23 17:52:27 2007 +0000
@@ -0,0 +1,63 @@
+# GnuMakefile for DStress http://dstress.kuehne.cn/www/dstress.html
+# Copyright (C) 2006 Thomas Kuehne
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+.PHONY:: \
+	complex/template_60/warning \
+	complex/template_60/$(complex_done) \
+	complex/template_60/clean \
+	complex/template_60/dest
+	
+complex/template_60/warning :
+	$(error "don't invoke this file directly, instead use DStress' root Makefile with the target \"complex/template_60/complex.done\", \"complex\" or \"all\"")
+
+complex/template_60/dest = \
+	complex/template_60/template_60_A \
+	complex/template_60/template_60_B
+
+# the actual target, will be called by root's "all" / "complex" target
+complex/template_60/$(complex_done) : $(complex/template_60/dest) $(return__) $(ifeq__)
+
+#
+# link
+#
+complex/template_60/template_60_A : complex/template_60/a.d complex/template_60/b.d $(return__) $(ifeq__)
+	@$(RM) -f complex/template_60/*.o
+	$(eval z_name = $@)
+	$(eval z_return = $(shell cd complex/template_60; $(return__) "$(DMD) $(DFLAGS) -c a.d $(to_log) && $(DMD) $(DFLAGS) -c b.d && $(DMD) $(DFLAGS) a.o b.o"))
+	@if $(ifeq__) $(z_return) 0; then \
+		 $(ECHO) "Torture-Sub-1/31-PASS: $(z_name)"; \
+	else \
+		$(ECHO) "Torture-Sub-1/31-FAIL: $(z_name)"; \
+	fi 
+
+complex/template_60/template_60_B : complex/template_60/a.d complex/template_60/b.d $(return__) $(ifeq__)
+	@$(RM) -f complex/template_60/*.o
+	$(eval z_name = $@)
+	$(eval z_return = $(shell cd complex/template_60; $(return__) "$(DMD) $(DFLAGS) a.d b.d $(to_log)"))
+	@if $(ifeq__) $(z_return) 0; then \
+		 $(ECHO) "Torture-Sub-1/31-PASS: $(z_name)"; \
+	else \
+		$(ECHO) "Torture-Sub-1/31-FAIL: $(z_name)"; \
+	fi 
+
+#
+# cleanup
+# 
+clean ::
+	$(RM) complex/template_60/*.done $(complex/template_60/dest) complex/template_60/*.o
+