Bug 2627 – std.traits.hasAliasing reports true for static arrays

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-01-27T22:15:00Z
Last change time
2015-06-09T01:21:00Z
Assigned to
andrei
Creator
wbaxter

Comments

Comment #0 by wbaxter — 2009-01-27T22:15:01Z
"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);
Comment #1 by dsimcha — 2010-06-30T20:28:04Z
Fixed SVN.