Skip to content
Browse files

fix Issue 9377 - Link-failure regression cause by fixing issue 8504

The test is disabled only in win64 platform.
  • Loading branch information...
1 parent 3d5528e commit 6a0be5b98961a773c7380ac45f14f1a8a76349b9 @9rnsr 9rnsr committed
View
8 src/expression.c
@@ -930,6 +930,14 @@ Type *functionParameters(Loc loc, Scope *sc, TypeFunction *tf,
{
fd->functionSemantic();
}
+ else if (fd && fd->parent)
+ {
+ TemplateInstance *ti = fd->parent->isTemplateInstance();
+ if (ti && ti->tempdecl)
+ {
+ fd->functionSemantic3();
+ }
+ }
size_t n = (nargs > nparams) ? nargs : nparams; // n = max(nargs, nparams)
View
1 test/Makefile
@@ -125,6 +125,7 @@ DISABLED_TESTS += testargtypes
DISABLED_TESTS += testxmm
DISABLED_SH_TESTS += test39
+DISABLED_SH_TESTS += test9377
endif
runnable_tests=$(wildcard runnable/*.d) $(wildcard runnable/*.sh)
View
11 test/runnable/extra-files/mul9377a.d
@@ -0,0 +1,11 @@
+import std.c.stdio;
+
+import mul9377b;
+
+void abc()
+{
+ printf("mul9377b.abc()\n");
+ foo();
+ bar();
+}
+
View
40 test/runnable/extra-files/mul9377b.d
@@ -0,0 +1,40 @@
+module mul9377b;
+
+import std.c.stdio;
+
+int j;
+
+int foo()()
+{
+ printf("foo()\n");
+ static int z = 7;
+ assert(z != 10);
+ return ++z;
+}
+
+void bar()
+{
+ assert(j == 7);
+ foo();
+ printf("bar\n");
+}
+
+template def()
+{
+ alias int defint;
+
+ static this()
+ {
+ printf("def.static this()\n");
+ j = 7;
+ }
+
+ //void mem(int){}
+ void mem()
+ {
+ printf("def().mem()\n");
+ }
+}
+
+def!().defint x;
+
View
13 test/runnable/extra-files/multi9377.d
@@ -0,0 +1,13 @@
+import std.c.stdio;
+
+import mul9377a, mul9377b;
+
+int main()
+{
+ printf("main\n");
+ abc();
+ def!().mem();
+ pragma(msg, def!().mem.mangleof);
+ return 0;
+}
+
View
17 test/runnable/test9377.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+src=runnable${SEP}extra-files
+dir=${RESULTS_DIR}${SEP}runnable
+
+if [ $OS == "win32" -o $OS == "win64" ]; then
+ LIBEXT=.lib
+else
+ LIBEXT=.a
+fi
+libname=${dir}${SEP}lib9377${LIBEXT}
+
+$DMD -m${MODEL} -I${src} -of${libname} -c ${src}${SEP}mul9377a.d ${src}${SEP}mul9377b.d -lib
+$DMD -m${MODEL} -I${src} -of${dir}${SEP}mul9377 ${src}${SEP}multi9377.d ${libname}
+
+rm ${dir}/{lib9377${LIBEXT},mul9377${OBJ},mul9377${EXE}}
+

0 comments on commit 6a0be5b

Please sign in to comment.
Something went wrong with that request. Please try again.