From 7442d6faa2719e4e7d33a7021c406c5a4facd74d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:02:28 +0000 Subject: Vendor import of clang trunk r300422: https://llvm.org/svn/llvm-project/cfe/trunk@300422 --- .../coroutine-unhandled_exception-warning.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/SemaCXX/coroutine-unhandled_exception-warning.cpp (limited to 'test/SemaCXX/coroutine-unhandled_exception-warning.cpp') diff --git a/test/SemaCXX/coroutine-unhandled_exception-warning.cpp b/test/SemaCXX/coroutine-unhandled_exception-warning.cpp new file mode 100644 index 0000000000000..f98e00d1a7092 --- /dev/null +++ b/test/SemaCXX/coroutine-unhandled_exception-warning.cpp @@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value + +#if __has_feature(cxx_exceptions) +#error This test requires exceptions be disabled +#endif + +#include "Inputs/std-coroutine.h" + +using std::experimental::suspend_always; +using std::experimental::suspend_never; + +struct promise_void { + void get_return_object(); + suspend_always initial_suspend(); + suspend_always final_suspend(); + void return_void(); +}; + +template +struct std::experimental::coroutine_traits { using promise_type = promise_void; }; + +void test0() { // expected-warning {{'promise_void' is required to declare the member 'unhandled_exception()' when exceptions are enabled}} + co_return; +} -- cgit v1.2.3