[llvm-bugs] [Bug 46428] New: Missing line and column number in error message "function with trailing return type must specify return type"

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 23 07:47:40 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46428

            Bug ID: 46428
           Summary: Missing line and column number in error message
                    "function with trailing return type must specify
                    return type"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: haoxintu at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

This code, bug.cc, Clang just emits error message but misses line and column
number of it.

$cat bug.cc
void
foo () {  
    try { }
    catch ( long ()  -> int ){}
} 

$clang++ -c bug.cc
error: function with trailing return type must specify return type 'auto', not
'long'
1 error generated.

While in GCC
$g++ -c bug.cc
bug.cc: In function ‘void foo()’:
bug.cc:4:25: error: ‘type name’ function with trailing return type not declared
with ‘auto’ type specifier
    4 |     catch ( long ()  -> int ){}
      |                         ^~~

Is it an valid try-block expression? I not sure about that. But anyway, Clang
should give appropriate full diagnostic message of it I think.

I have tested in recently released Clang versions, they all have this issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200623/d61942f2/attachment.html>


More information about the llvm-bugs mailing list