diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-20 21:20:51 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-20 21:20:51 +0000 |
commit | 583e75cce441388bc562fa225d23499261a0091e (patch) | |
tree | 5944a7c248d4a8c858db45abc3444eb69270a3c8 /test/SemaCXX/coroutine-unhandled_exception-warning.cpp | |
parent | 7442d6faa2719e4e7d33a7021c406c5a4facd74d (diff) |
Notes
Diffstat (limited to 'test/SemaCXX/coroutine-unhandled_exception-warning.cpp')
-rw-r--r-- | test/SemaCXX/coroutine-unhandled_exception-warning.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/SemaCXX/coroutine-unhandled_exception-warning.cpp b/test/SemaCXX/coroutine-unhandled_exception-warning.cpp index f98e00d1a7092..d7f6066109a5f 100644 --- a/test/SemaCXX/coroutine-unhandled_exception-warning.cpp +++ b/test/SemaCXX/coroutine-unhandled_exception-warning.cpp @@ -1,4 +1,11 @@ -// 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 +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts \ +// RUN: -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify \ +// RUN: -fblocks -Wno-unreachable-code -Wno-unused-value + +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts \ +// RUN: -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify \ +// RUN: -fblocks -Wno-unreachable-code -Wno-unused-value \ +// RUN: -DDISABLE_WARNING -Wno-coroutine-missing-unhandled-exception #if __has_feature(cxx_exceptions) #error This test requires exceptions be disabled @@ -19,6 +26,12 @@ struct promise_void { template <typename... T> struct std::experimental::coroutine_traits<void, T...> { using promise_type = promise_void; }; +#ifndef DISABLE_WARNING void test0() { // expected-warning {{'promise_void' is required to declare the member 'unhandled_exception()' when exceptions are enabled}} co_return; } +#else +void test0() { // expected-no-diagnostics + co_return; +} +#endif |