llvm-project/clang/lib
Xun Li 516803dc86 [Coroutines] Ensure co_await promise.final_suspend() does not throw
Summary:
This patch addresses https://bugs.llvm.org/show_bug.cgi?id=46256
The spec of coroutine requires that the expression co_­await promise.final_­suspend() shall not be potentially-throwing.
To check this, we recursively look at every call (including Call, MemberCall, OperatorCall and Constructor) in all code
generated by the final suspend, and ensure that the callees are declared with noexcept. We also look at any returned data
type that requires explicit destruction, and check their destructors for noexcept.

This patch does not check declarations with dependent types yet, which will be done in future patches.

Updated all tests to add noexcept to the required functions, and added a dedicated test for this patch.

This patch might start to cause existing codebase fail to compile because most people may not have been strict in tagging
all the related functions noexcept.

Reviewers: lewissbaker, modocache, junparser

Reviewed By: modocache

Subscribers: arphaman, junparser, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82029
2020-06-22 15:01:42 -07:00
..
ARCMigrate [NFC] Refactoring PropertyAttributeKind for ObjCPropertyDecl and ObjCDeclSpec. 2020-04-23 17:21:25 -04:00
AST Implement constexpr BinaryOperator for vector types 2020-06-22 07:05:43 -07:00
ASTMatchers [ASTMatcher] Correct memoization bug ignoring direction (descendants or ancestors) 2020-06-22 12:56:29 +02:00
Analysis Assignment and Inc/Dec operators wouldn't register as a mutation when Implicit Paren Casts were present 2020-06-09 19:45:57 +01:00
Basic [X86] Remove encoding value from the X86_FEATURE and X86_FEATURE_COMPAT macro. NFCI 2020-06-22 11:46:21 -07:00
CodeGen [X86] Remove encoding value from the X86_FEATURE and X86_FEATURE_COMPAT macro. NFCI 2020-06-22 11:46:21 -07:00
CrossTU [analyzer] On-demand parsing capability for CTU 2020-06-11 10:56:59 +02:00
DirectoryWatcher [DirectoryWatcher] Do not use FSEvents on non-macOS platforms 2020-04-23 10:22:28 -07:00
Driver Add Statically Linked Libraries 2020-06-22 19:48:49 +00:00
Edit [C++2a] Add __builtin_bit_cast, used to implement std::bit_cast 2019-07-02 18:28:13 +00:00
Format [clang/llvm] As part of using inclusive language within 2020-06-20 16:03:58 -07:00
Frontend add option to instantiate templates already in the PCH 2020-06-21 17:05:52 +02:00
FrontendTool [NFC] Refactor Registry loops to range for 2020-06-19 00:40:10 +01:00
Headers [PowerPC][Power10] Implement Vector Clear Left/Rightmost Bytes Builtins in LLVM/Clang 2020-06-20 18:29:16 -05:00
Index [ARM] Add __bf16 as new Bfloat16 C Type 2020-06-05 10:32:43 +01:00
Lex [AST/Lex/Parse/Sema] As part of using inclusive language within 2020-06-20 01:15:32 -07:00
Parse Revert commit 9e52530 because of dependencies issue 2020-06-22 09:56:14 -04:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema [Coroutines] Ensure co_await promise.final_suspend() does not throw 2020-06-22 15:01:42 -07:00
Serialization Return false if the identifier is not in the global module index. 2020-06-22 08:03:11 +00:00
StaticAnalyzer [Analyzer][StreamChecker] Add note tags for file opening. 2020-06-22 11:15:35 +02:00
Testing Fix MSVC "not all control paths return a value" warning. NFC. 2020-06-05 10:45:59 +01:00
Tooling Revert commit 9e52530 because of dependencies issue 2020-06-22 09:56:14 -04:00
CMakeLists.txt Move unittest helpers to a shared location 2020-05-29 16:47:33 +02:00