[PATCH] D21232: Add attribute noreturn to functions that throw in std::vector

Aditya Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 10 10:36:42 PDT 2016


hiraditya created this revision.
hiraditya added reviewers: mclow.lists, howard.hinnant.
hiraditya added subscribers: laxmansole, sebpop, llvm-commits.

There might be other places where we would like to add this attribute. I still need to investigate.

Worked in collaboration with Sebastian Pop.

http://reviews.llvm.org/D21232

Files:
  include/vector

Index: include/vector
===================================================================
--- include/vector
+++ include/vector
@@ -290,8 +290,8 @@
 {
 protected:
     _LIBCPP_ALWAYS_INLINE __vector_base_common() {}
-    void __throw_length_error() const;
-    void __throw_out_of_range() const;
+    void __throw_length_error() const __attribute__((__noreturn__));
+    void __throw_out_of_range() const __attribute__((__noreturn__));
 };
 
 template <bool __b>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21232.60373.patch
Type: text/x-patch
Size: 463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160610/1a648aa8/attachment.bin>


More information about the llvm-commits mailing list