www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5432] New: if/for/while inconsistency: while( auto a = ... ) does not compile

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

           Summary: if/for/while inconsistency: while( auto a = ... ) does
                    not compile
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: eric.estievenart free.fr



06:31:02 PST ---
void f()
{
  Object get() { return null; }
  if( auto a = get() )                {} // OK
  for( auto a = get(); a; a = get() ) {} // OK
  while( auto a = get() )             {} // Does not compile
}

autowhile.d(7): expression expected, not 'auto'
autowhile.d(7): found 'a' when expecting ')'
autowhile.d(7): found '=' instead of statement
autowhile.d(8): unrecognized declaration

This is clearly inconsistent, so logged as a bug and not an enhancement.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 08 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5432


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



*** Issue 6550 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 27 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5432


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies gmail.com
          Component|websites                    |DMD
            Summary|if/for/while inconsistency: |Allow variable declaration
                   |while( auto a = ... ) does  |inside while condition
                   |not compile                 |
           Severity|normal                      |enhancement


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 27 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5432


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch



https://github.com/D-Programming-Language/dmd/pull/342

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 27 2011