[LLVMbugs] [Bug 15435] New: -Wshadow does not warn about catch handler exception shadowing local variable

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 4 01:46:01 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15435

            Bug ID: 15435
           Summary: -Wshadow does not warn about catch handler exception
                    shadowing local variable
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: stephan.bergmann.secondary at googlemail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

At least with any of Clang 3.1 (as packaged for Fedora 18), 3.2, or recent
trunk, running "clang++ -Wshadow -c test.cc" on

> #include <new>
> int * f() {
>     int * e;
>     try {
>         e = new int();
>     } catch (std::bad_alloc & e) {
>         throw e;
>     }
>     return e;
> }

does not warn about the "std::bad_alloc & e" exception declaration in the catch
handler shadowing the local variable declaration "int * e".

-- 
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/20130304/439c1614/attachment.html>


More information about the llvm-bugs mailing list