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

            Bug ID: 48463
           Summary: [MSVC compat] Null checks for non-noexcept allocation
                    functions
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: dma...@mozilla.com
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
                    neeil...@live.com, richard-l...@metafoo.co.uk

https://godbolt.org/z/h955c9

In the example above, clang tests the result of an allocation for null iff the
allocation function is marked noexcept. This makes sense, and agrees with my
reading of https://eel.is/c++draft/expr.new#20, but MSVC includes the null
check regardless of the exception specification. Should clang do the same when
targeting Windows?

(This was reduced from a real-world crash that occurred because the code put
the noexcept behind an #ifndef _MSC_VER, probably due to lack of support at the
time.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to