www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7793] New: static assert( void_function() ) gives misleading error message

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7793

           Summary: static assert( void_function() ) gives misleading
                    error message
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au



void f(){}
static assert(f());

----
bug.d(10): Error: cannot evaluate f() at compile time
bug.d(10):        while evaluating: static assert(f())

But actually f() was successfully evaluated at compile time!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 29 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7793


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic



And it also applies to static if.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7793




Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/8a1f31f4b2307fc4dc3c068d928ab9e26ea0ae11
fix
Issue 7793 - static assert( void_function() ) gives misleading error message


Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3bfac1394e3d123aa487fd6a1ccf62b06ca8c9b1
fix
Issue 7793 - static assert( void_function() ) gives misleading error message

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7793




Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/8a1f31f4b2307fc4dc3c068d928ab9e26ea0ae11
fix
Issue 7793 - static assert( void_function() ) gives misleading error message


Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3bfac1394e3d123aa487fd6a1ccf62b06ca8c9b1
fix
Issue 7793 - static assert( void_function() ) gives misleading error message

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7793


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 22 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7793




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/6610acf74883822609e165a470fbe6c812e03692
Fix regression introduced by issue 7793 fix.

In 3bfac13, inc is set to 2 instead of 0, which causes errors to go by
unnoticed in some circumstances.

An alternative fix for 7793 would be to only skip invoking e->ctfeInterpret()
if the type is not bool – I'm not sure why/if returning early is preferrable
here.

https://github.com/D-Programming-Language/dmd/commit/7e501522c15ff03e4460e25cdba5c1ce2e85f445


Fix regression introduced by issue 7793 fix.

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