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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to