[llvm-bugs] [Bug 46713] New: Clang accepts default arguments in a try-catch block

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 14 05:28:02 PDT 2020


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

            Bug ID: 46713
           Summary: Clang accepts default arguments in a try-catch block
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          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

Hi, all.

This code, test.cc, is an invalid code I guess, but Clang accepts it.

$cat test.cc
int main(){
    try { }
    catch ( auto ( int = 0, int) -> int ){}
    return 0;
}

While output in GCC:
error: default arguments are only permitted for function parameters
[-fpermissive]

Output in ICC:
error #1077: specifying a default argument on this declaration is nonstandard

All Clang versions from 6.0 behave the same.

So is this a accept-invalid bug in Clang?  Or Clang just does this for
intentionally?

Thanks,
Haoxin

-- 
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/20200714/7f813c54/attachment.html>


More information about the llvm-bugs mailing list