www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2627] New: std.traits.hasAliasing reports true for static arrays

reply d-bugmail puremagic.com writes:
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: bugzilla digitalmars.com
        ReportedBy: wbaxter gmail.com


"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);


-- 
Jan 27 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2627


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com
         AssignedTo|nobody puremagic.com        |andrei metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 11 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2627


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |dsimcha yahoo.com
         Resolution|                            |FIXED


--- Comment #1 from David Simcha <dsimcha yahoo.com> 2010-06-30 20:28:04 PDT ---
Fixed SVN.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 30 2010