http://d.puremagic.com/issues/show_bug.cgi?id=2627
Summary: std.traits.hasAliasing reports true for static arrays
Product: D
Version: 2.023
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
"hasAliasing" reports true even for static arrays.
struct X { float[3] vals; }
pragma(msg, hasAliasing!(X)?"true":"false"); --> true
---
One fix would be to change this (around line 342):
else static if (is(T[0] foo : U[], U))
enum hasRawAliasing = !is(U == invariant);
To this:
else static if (is(T[0] foo : U[], U))
enum hasRawAliasing = !is(U == invariant) && (!isStaticArray!(T[0])
|| hasRawPointerImpl!(U).result);
--