www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16447] New: Warn about auto return type when no return


          Issue ID: 16447
           Summary: Warn about auto return type when no return statement
                    is present
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

When an auto function contains no return statement a warning could be emitted.


auto foo(int x)
        add RAX, 1;

The return type here is "void". Other case can exist, even w/o iasm, where the
coder can get strange and inaccurate error message if he's forget his return

- When an auto function, depending on the static if conditions, returns void or
something then no warning, b/c to return the something a return statement is
- When an auto function returns void and contains no return statement, warn.

Aug 31 2016