[llvm-bugs] [Bug 34804] New: -Wexceptions warns about caught exception in noexcept function

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 2 09:18:00 PDT 2017


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

            Bug ID: 34804
           Summary: -Wexceptions warns about caught exception in noexcept
                    function
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: redbeard0531 at gmail.com
                CC: llvm-bugs at lists.llvm.org

> clang++ -Wexceptions -c test.cpp -std=c++14
test.cpp:3:9: warning: 'boom' has a non-throwing exception specification but
can still throw [-Wexceptions]
        throw;
        ^
test.cpp:1:6: note: function declared non-throwing here
void boom() noexcept {
     ^      ~~~~~~~~
1 warning generated.


> cat test.cpp
void boom() noexcept {
    try {
        throw;
    } catch (...) {
    }
}


This is a reduced repro from the following real-world code:
https://github.com/mongodb/mongo/blob/r3.5.13/src/mongo/util/assert_util.cpp#L247-L267

-- 
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/20171002/17c1eb9a/attachment.html>


More information about the llvm-bugs mailing list