[Issue 16525] C++ member variables have no mangling

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16525

--- Comment #1 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/376b34d10968c0ea0169fe1c6876b7b3227dea0e
fix Issue 16525 - C++ member variables have no mangling

- while there seems to be no way to require mangling of C++ member
  variables in C++ itself, D does need the mangling for template parameters
- use the same mangling as for static member variables

https://github.com/dlang/dmd/commit/89e098f1bb7946166757ab3f0d03737a0b5c5ef9
Merge pull request #6147 from MartinNowak/fix16525

fix Issue 16525 - C++ member variables have no mangling

--


[Issue 16525] C++ member variables have no mangling

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16525

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 16537] [ndslice] cannot use slice as in function parameter, error on opIndex

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16537

Ryan  changed:

   What|Removed |Added

 CC||clumsycodemon...@gmail.com

--


[Issue 16537] New: [ndslice] cannot use slice as in function parameter, error on opIndex

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16537

  Issue ID: 16537
   Summary: [ndslice] cannot use slice as in function parameter,
error on opIndex
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: major
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: clumsycodemon...@gmail.com

The operators of an ndslice object don't handle const very well, which makes it
difficult to write functions that take slices as in parameters. See sum slice
functions below, the one that takes in parameters requires casts to work!


alias MyMatrix = Slice!(2,double*);

MyMatrix sumSlice(MyMatrix a, MyMatrix b)
{
  assert(a.shape == b.shape);

  auto rows = a.shape[0];
  auto cols = a.shape[1];
  auto result = (new double[a.elementsCount]).sliced(rows, cols);

  foreach(r; 0..rows) foreach(c; 0..cols) result[r,c] = a[r,c] + b[r,c];

  return result;
}

MyMatrix sumSlice2(in MyMatrix a, in MyMatrix b)
{
  assert(a.shape == b.shape);

  auto rows = a.shape[0];
  auto cols = a.shape[1];
  auto result = (new double[a.elementsCount]).sliced(rows, cols);

  foreach(r; 0..rows) 
foreach(c; 0..cols) 
  // Casts required to compile!!
  result[r,c] = (cast()a)[r,c] + (cast()b)[r,c];

  return result;
}


I was using ndslice as a matrix and trying to write functions to do matrix
factorizations where I did not destroy the original matrix. So it makes sense
to be able to use opIndex in this way.

--


[Issue 16517] topN performance very poor on certain data sets

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16517

--- Comment #4 from Jon Degenhardt  ---
I took a try at building the pull request as part of a local LDC instance, but
hit incompatibilities in other code files. Will have to wait on the LDC tests.

--


[Issue 16473] operator overloading is broken

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16473

Ryan  changed:

   What|Removed |Added

  Component|dmd |phobos

--


[Issue 16473] operator overloading is broken

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16473

--- Comment #1 from Ryan  ---
I was able to fix it by adding `-` to the list of accepted strings in the if
statement. So now the function signature looks like this

auto ref opIndexUnary(string op, Indexes...)(Indexes _indexes)
if (isFullPureIndex!Indexes && (op == `++` || op == `--` || op ==
`-`))


This works for the case reported in the original ticket. Not sure what to do
about the overload that takes slices. The semantically typical thing to do
would be return a new slice with a new array underneath it that has the negated
values, so as to not modify the underlying array. But that would cause an
allocation.

--


[Issue 16473] operator overloading is broken

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16473

Ryan  changed:

   What|Removed |Added

 CC||clumsycodemon...@gmail.com

--


[Issue 15583] [REG] topN without uniform can show quadratic performance

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15583

--- Comment #5 from Andrei Alexandrescu  ---
https://github.com/dlang/phobos/pull/4815 should fix this

--


[Issue 16530] -O -cov interaction leads to wrong codegen

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16530

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/ad382b87d3f0a9f8992fe836165e26a68724ad77
fix Issue 16530 - -O -cov interaction leads to wrong codegen

https://github.com/dlang/dmd/commit/a46db4fae2a4fee21bbd67c6be5859054a2fa4c7
Merge pull request #6151 from WalterBright/fix16530

[critical] fix Issue 16530 - -O -cov interaction leads to wrong codegen

--


[Issue 16535] writeln("a") is safe, stdout.writeln("a") is not

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16535

Walter Bright  changed:

   What|Removed |Added

   Keywords||safe
 CC||bugzi...@digitalmars.com

--


[Issue 16536] DMD master does not build on OS X 10.11.6/Xcode 7.3.1

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16536

--- Comment #2 from David Nadlinger  ---
I'm using the stock Apple Clang shipped with Xcode 7.3.1. Is this the unsigned
long vs. unsigned long long mangling problem coming back to haunt us again?

---
$ clang -dM -E test.cpp
#define OBJC_NEW_PROPERTIES 1
#define _LP64 1
#define __APPLE_CC__ 6000
#define __APPLE__ 1
#define __ATOMIC_ACQUIRE 2
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_CONSUME 1
#define __ATOMIC_RELAXED 0
#define __ATOMIC_RELEASE 3
#define __ATOMIC_SEQ_CST 5
#define __BIGGEST_ALIGNMENT__ 16
#define __BLOCKS__ 1
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __CHAR16_TYPE__ unsigned short
#define __CHAR32_TYPE__ unsigned int
#define __CHAR_BIT__ 8
#define __CONSTANT_CFSTRINGS__ 1
#define __DBL_DECIMAL_DIG__ 17
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __DBL_DIG__ 15
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_MAX_10_EXP__ 308
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
#define __DEPRECATED 1
#define __DYNAMIC__ 1
#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 101100
#define __EXCEPTIONS 1
#define __FINITE_MATH_ONLY__ 0
#define __FLT_DECIMAL_DIG__ 9
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_DIG__ 6
#define __FLT_EPSILON__ 1.19209290e-7F
#define __FLT_EVAL_METHOD__ 0
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MANT_DIG__ 24
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN__ 1.17549435e-38F
#define __FLT_RADIX__ 2
#define __FXSR__ 1
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define __GNUC_GNU_INLINE__ 1
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC__ 4
#define __GNUG__ 4
#define __GXX_ABI_VERSION 1002
#define __GXX_RTTI 1
#define __GXX_WEAK__ 1
#define __INT16_C_SUFFIX__
#define __INT16_FMTd__ "hd"
#define __INT16_FMTi__ "hi"
#define __INT16_MAX__ 32767
#define __INT16_TYPE__ short
#define __INT32_C_SUFFIX__
#define __INT32_FMTd__ "d"
#define __INT32_FMTi__ "i"
#define __INT32_MAX__ 2147483647
#define __INT32_TYPE__ int
#define __INT64_C_SUFFIX__ LL
#define __INT64_FMTd__ "lld"
#define __INT64_FMTi__ "lli"
#define __INT64_MAX__ 9223372036854775807LL
#define __INT64_TYPE__ long long int
#define __INT8_C_SUFFIX__
#define __INT8_FMTd__ "hhd"
#define __INT8_FMTi__ "hhi"
#define __INT8_MAX__ 127
#define __INT8_TYPE__ signed char
#define __INTMAX_C_SUFFIX__ L
#define __INTMAX_FMTd__ "ld"
#define __INTMAX_FMTi__ "li"
#define __INTMAX_MAX__ 9223372036854775807L
#define __INTMAX_TYPE__ long int
#define __INTMAX_WIDTH__ 64
#define __INTPTR_FMTd__ "ld"
#define __INTPTR_FMTi__ "li"
#define __INTPTR_MAX__ 9223372036854775807L
#define __INTPTR_TYPE__ long int
#define __INTPTR_WIDTH__ 64
#define __INT_FAST16_FMTd__ "hd"
#define __INT_FAST16_FMTi__ "hi"
#define __INT_FAST16_MAX__ 32767
#define __INT_FAST16_TYPE__ short
#define __INT_FAST32_FMTd__ "d"
#define __INT_FAST32_FMTi__ "i"
#define __INT_FAST32_MAX__ 2147483647
#define __INT_FAST32_TYPE__ int
#define __INT_FAST64_FMTd__ "ld"
#define __INT_FAST64_FMTi__ "li"
#define __INT_FAST64_MAX__ 9223372036854775807L
#define __INT_FAST64_TYPE__ long int
#define __INT_FAST8_FMTd__ "hhd"
#define __INT_FAST8_FMTi__ "hhi"
#define __INT_FAST8_MAX__ 127
#define __INT_FAST8_TYPE__ signed char
#define __INT_LEAST16_FMTd__ "hd"
#define __INT_LEAST16_FMTi__ "hi"
#define __INT_LEAST16_MAX__ 32767
#define __INT_LEAST16_TYPE__ short
#define __INT_LEAST32_FMTd__ "d"
#define __INT_LEAST32_FMTi__ "i"
#define __INT_LEAST32_MAX__ 2147483647
#define __INT_LEAST32_TYPE__ int
#define __INT_LEAST64_FMTd__ "ld"
#define __INT_LEAST64_FMTi__ "li"
#define __INT_LEAST64_MAX__ 9223372036854775807L
#define __INT_LEAST64_TYPE__ long int
#define __INT_LEAST8_FMTd__ "hhd"
#define __INT_LEAST8_FMTi__ "hhi"
#define __INT_LEAST8_MAX__ 127
#define __INT_LEAST8_TYPE__ signed char
#define __INT_MAX__ 2147483647
#define __LDBL_DECIMAL_DIG__ 21
#define __LDBL_DENORM_MIN__ 3.64

[Issue 16536] DMD master does not build on OS X 10.11.6/Xcode 7.3.1

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16536

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
Note the following from cdef.h:

#if defined(__UINT64_TYPE__)
typedef __INT64_TYPE__ targ_llong;
typedef __UINT64_TYPE__targ_ullong;
#elif defined(__UINTMAX_TYPE__)
typedef __INTMAX_TYPE__targ_llong;
typedef __UINTMAX_TYPE__   targ_ullong;
#else
typedef long long  targ_llong;
typedef unsigned long long targ_ullong;
#endif

Which of these is the C++ compiler on your machine doing? Is there another
macro it should be doing? Getting this right is necessary for the name mangling
to match what D generates for 'long' and 'ulong'.

The way to determine the pertinent macro is to have your C++ compiler dump all
its predefined macros, once for -m32 and once for -m64. Diff the two, and find
the relevant macro.

--


[Issue 16536] New: DMD master does not build on OS X 10.11.6/Xcode 7.3.1

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16536

  Issue ID: 16536
   Summary: DMD master does not build on OS X 10.11.6/Xcode 7.3.1
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: c...@klickverbot.at

---
$ cd dmd
$ git show
commit d8be50edd4106ca498ed09a9b3a445240de5cf47
[…]
$ make -f posix.mak
[…]
Undefined symbols for architecture x86_64:
  "symboldata(unsigned long long, unsigned int)", referenced from:
  el_ptr(Symbol*) in backend.a(el.o)
  el_convstring(elem*) in backend.a(el.o)
  out_readonly_sym(unsigned int, void*, int) in backend.a(out.o)
  Obj::sym_cdata(unsigned int, char*, int) in backend.a(machobj.o)
  "_align(unsigned long long, unsigned long long)", referenced from:
  codgen() in backend.a(cgcod.o)
  stackoffsets(int) in backend.a(cgcod.o)
  outjmptab(block*) in backend.a(cod3.o)
  outswitab(block*) in backend.a(cod3.o)
  type_paramsize(TYPE*) in backend.a(type.o)
  alignOffset(int, unsigned long long) in backend.a(out.o)
  cdfunc(elem*, unsigned int*) in backend.a(cod1.o)
  ...
---

This is on linking the DMD executable.

Xcode 7.3.1:

---
$ clang --version
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
---


Host DMD from Homebrew:
---
$ dmd --version
DMD64 D Compiler v2.071.1
---


This seems to be fallout from translating msc.c to D.

--


[Issue 16506] segfaults in std.experimental.allocator: FreeTree with GCAllocator or Mallocator

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16506

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 16507] std.experimental.allocator: FreeTree clears too eagerly

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16507

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/46599a63ed899276bff5053970e468bce645e3fc
fix issue 16507 - std.experimental.allocator: FreeTree clears too eagerly

Try parent allocator without clearing first. Documentation says so.

https://github.com/dlang/phobos/commit/25418edb0611ca6de06c6a8d7281407cd4c9a2e6
Merge pull request #4798 from aG0aep6G/FreeTree

std.experimental.allocator: fix FreeTree issues 16506 and 16507

--


[Issue 16507] std.experimental.allocator: FreeTree clears too eagerly

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16507

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 16506] segfaults in std.experimental.allocator: FreeTree with GCAllocator or Mallocator

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16506

--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/2a2e04b9c7b0c7fa10b22254b95aa2cb7826a82c
fix issue 16506 - segfaults in std.experimental.allocator: FreeTree with
GCAllocator or Mallocator

https://github.com/dlang/phobos/commit/25418edb0611ca6de06c6a8d7281407cd4c9a2e6
Merge pull request #4798 from aG0aep6G/FreeTree

std.experimental.allocator: fix FreeTree issues 16506 and 16507

--


[Issue 16534] RefRange should define opDollar if it defines length

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16534

--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/8dd953827c9b211c76985b48a9409c2ba0fcfd19
Fix issue 16534 - RefRange should define opDollar if it defines length

https://github.com/dlang/phobos/commit/8c16746cc8a54ba1f9222f62b408c590e3d2fd69
Merge pull request #4817 from
ZombineDev/fix-16534-refrange-should-define-dollar-if-possible

Fix issue 16534 - RefRange should define opDollar if it defines length

--


[Issue 16534] RefRange should define opDollar if it defines length

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16534

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 16534] RefRange should define opDollar if it defines length

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16534

ZombineDev  changed:

   What|Removed |Added

   Keywords||pull
 CC||petar.p.ki...@gmail.com

--- Comment #2 from ZombineDev  ---
PR: https://github.com/dlang/phobos/pull/4817

--


[Issue 16528] @safe inference does not work for mutually recursive functions

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16528

Lodovico Giaretta  changed:

   What|Removed |Added

   Hardware|x86_64  |All

--


[Issue 16535] New: writeln("a") is safe, stdout.writeln("a") is not

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16535

  Issue ID: 16535
   Summary: writeln("a") is safe, stdout.writeln("a") is not
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: and...@erdani.com

There must have been some divergence in the source code somewhere. The global
should forward to the member and both should be safe.

--


[Issue 16534] RefRange should define opDollar if it defines length

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16534

--- Comment #1 from Andrei Alexandrescu  ---
See also: http://forum.dlang.org/post/ns66l7$1sp5$1...@digitalmars.com

--


[Issue 16534] New: RefRange should define opDollar if it defines length

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16534

  Issue ID: 16534
   Summary: RefRange should define opDollar if it defines length
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: and...@erdani.com

That's pretty much it.

--


[Issue 16530] -O -cov interaction leads to wrong codegen

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16530

Walter Bright  changed:

   What|Removed |Added

   Keywords||pull, wrong-code
 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
https://github.com/dlang/dmd/pull/6151

--


[Issue 16533] New: Cannot compile two file with same name

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16533

  Issue ID: 16533
   Summary: Cannot compile two file with same name
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: iamthewilsona...@hotmail.com

DMDFE:

ldc2 ../a/bar.d ../b/bar.d
Error: module bar from file ../b/bar.d conflicts with another module bar from
file ../a/bar.d


causes ldc to fail even with -oq (output module *.o's with their fully
qualified name) switch, which is supposed to allow this.

It did work around about July.

see https://github.com/ldc-developers/ldc/issues/1781

this blocks having a sane layout for dcompute.

--


[Issue 16527] extern( C++ ) Win64 build - return struct by value is broken

2016-09-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16527

--- Comment #1 from ki...@gmx.net ---
We have a special case for this in LDC. MSVC passes `this` before `sret`,
unlike most other ABIs.

--