[coroutines] Fix building of new/delete expressions when get_return_object_on_allocat...
authorEric Fiselier <eric@efcs.ca>
Sun, 16 Apr 2017 09:19:59 +0000 (09:19 +0000)
committerEric Fiselier <eric@efcs.ca>
Sun, 16 Apr 2017 09:19:59 +0000 (09:19 +0000)
commit627a63cf5081bfe7dfbb711ff8bc1f5fbf8c3d20
treecd7d6f3b2c685d596d5706ac1cde137b3ebe57ab
parent9ad496b2c8b9c2c41dc03cbc3e7529fc02a310ef
[coroutines] Fix building of new/delete expressions when get_return_object_on_allocation_failure() is present.

Summary:
This patch implements [dcl.fct.def.coroutine]p8:
> The unqualified-id get_return_object_on_allocation_failure is looked up in the scope of
> class P by class member access lookup (3.4.5). If a declaration is found, ..., and if a
> global allocation function is selected, the ::operator new(size_t, nothrow_t) form shall be used.
> [...]
> The allocation function used in this case must have a non-throwing noexcept-specification.

Reviewers: GorNishanov, rsmith, majnemer, aaron.ballman

Reviewed By: GorNishanov

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D31562

llvm-svn: 300420
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaCoroutine.cpp
clang/test/CodeGenCoroutines/coro-alloc.cpp
clang/test/SemaCXX/coroutines.cpp