www.digitalmars.com         C & C++   DMDScript  

D.gnu - Different behaviour between gcd and dmd

reply "Juanjo Alvarez" <juanjux gmail.com> writes:
test:

void main()
{
     import std.array;
     const lines = ["abc", "def"];
     auto res = std.array.join(lines, "\n");
}

DMD: compiles and work
GCD: compile error:

test.d:6: error: template std.array.join cannot deduce function 
from argument types !()(const(immutable(char)[][]), string), 
candidates are:
/home/juanjux/descargas/x86_64-gdcproject-linux-gnu/include/d/4.9
0/std/array.d:1526: 
note: std.array.join(RoR, R)(RoR ror, R sep) if (isInputRange!RoR 
&& isInputRange!(ElementType!RoR) && isInputRange!R && 
is(Unqual!(ElementType!(ElementType!RoR)) == 
Unqual!(ElementType!R)))
/home/juanjux/descargas/x86_64-gdcproject-linux-gnu/include/d/4.9
0/std/array.d:1573: 
note: std.array.join(RoR)(RoR ror) if (isInputRange!RoR && 
isInputRange!(ElementType!RoR))
Sep 02 2014
next sibling parent "Juanjo Alvarez" <juanjux gmail.com> writes:
Sorry, forgot to post versions ( excuse: I just returned from a 
dinner and I'm a little drunk):

DMD: 2.0.65 and 2.0.66
GCD: (package downloaded from the site, Linux 64bits native):

Using built-in specs.
COLLECT_GCC=/home/juanjux/descargas/x86_64-gdcproject-linux-gnu/bin/gdc
COLLECT_LTO_WRAPPER=/home/juanjux/descargas/x86_64-gdcproject-linux-gnu/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: 
/home/build/tmp/native_build/.build/src/gcc-4.9.0/configure 
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu 
--target=x86_64-unknown-linux-gnu 
--prefix=/home/build/tmp/install/x86_64-gdcproject-linux-gnu 
--enable-languages=c,c++,d --with-pkgversion='crosstool-NG 
hg+unknown-20140610.075849 - 20140615-2.065-a8ad6a6678' 
--with-bugurl=http://gdcproject.org/bugzilla/ 
--disable-sjlj-exceptions --enable-__cxa_atexit 
--disable-libmudflap --disable-libgomp --disable-libssp 
--disable-libquadmath --disable-libquadmath-support 
--with-gmp=/home/build/tmp/native_build/.build/x86_64-gdcproject-
inux-gnu/buildtools 
--with-mpfr=/home/build/tmp/native_build/.build/x86_64-gdcproject-
inux-gnu/buildtools 
--with-mpc=/home/build/tmp/native_build/.build/x86_64-gdcproject-
inux-gnu/buildtools 
--with-isl=/home/build/tmp/native_build/.build/x86_64-gdcproject-
inux-gnu/buildtools 
--with-cloog=/home/build/tmp/native_build/.build/x86_64-gdcproject-
inux-gnu/buildtools 
--with-libelf=/home/build/tmp/native_build/.build/x86_64-gdcproject-
inux-gnu/buildtools 
--enable-threads=posix --enable-target-optspace --disable-nls 
--disable-multilib --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.9.0 (crosstool-NG hg+unknown-20140610.075849 - 
20140615-2.065-a8ad6a6678)


On Tuesday, 2 September 2014 at 20:49:26 UTC, Juanjo Alvarez 
wrote:
 test:

 void main()
 {
     import std.array;
     const lines = ["abc", "def"];
     auto res = std.array.join(lines, "\n");
 }

 DMD: compiles and work
 GCD: compile error:

 test.d:6: error: template std.array.join cannot deduce function 
 from argument types !()(const(immutable(char)[][]), string), 
 candidates are:
 /home/juanjux/descargas/x86_64-gdcproject-linux-gnu/include/d/4.9
0/std/array.d:1526: 
 note: std.array.join(RoR, R)(RoR ror, R sep) if 
 (isInputRange!RoR && isInputRange!(ElementType!RoR) && 
 isInputRange!R && is(Unqual!(ElementType!(ElementType!RoR)) == 
 Unqual!(ElementType!R)))
 /home/juanjux/descargas/x86_64-gdcproject-linux-gnu/include/d/4.9
0/std/array.d:1573: 
 note: std.array.join(RoR)(RoR ror) if (isInputRange!RoR && 
 isInputRange!(ElementType!RoR))
Sep 02 2014
prev sibling parent "ketmar via D.gnu" <d.gnu puremagic.com> writes:
On Tue, 02 Sep 2014 20:49:24 +0000
"Juanjo Alvarez via D.gnu" <d.gnu puremagic.com> wrote:

it's a bug in std.array that was fixed after 2.065 lands in GDC.
it's commit ce7d4ed26a81ad44218f8948e5f83f36bc461029

you can either apply this change manually or wait until 2.066 lands.
Sep 02 2014