diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-11-01 01:31:23 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-11-01 01:31:23 +0000 |
| commit | 9095e5bf7e4fc06e3b683228ac8da975fc254a55 (patch) | |
| tree | 5a2624bb5f1f96c6f707f02b4b83502631c7a1f0 /clang/test | |
| parent | e322332a096aa2c1862a1c25239e3ec2dfc9346a (diff) | |
| download | bcm5719-llvm-9095e5bf7e4fc06e3b683228ac8da975fc254a55.tar.gz bcm5719-llvm-9095e5bf7e4fc06e3b683228ac8da975fc254a55.zip | |
p0012: Teach resolving address of overloaded function with dependent exception
specification to resolve the exception specification as part of the type check,
in C++1z onwards. This is not actually part of P0012 / CWG1330 rules for when
an exception specification is "needed", but is necessary for sanity.
llvm-svn: 285663
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaCXX/cxx1z-noexcept-function-type.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/cxx1z-noexcept-function-type.cpp b/clang/test/SemaCXX/cxx1z-noexcept-function-type.cpp index 77d073f0109..72b28432ef0 100644 --- a/clang/test/SemaCXX/cxx1z-noexcept-function-type.cpp +++ b/clang/test/SemaCXX/cxx1z-noexcept-function-type.cpp @@ -17,7 +17,19 @@ template<typename A, typename B> void redecl3() throw(B); typedef int I; template<bool B> void redecl4(I) noexcept(B); -template<bool B> void redecl4(I) noexcept(B); +template<bool B> void redecl4(I) noexcept(B); // expected-note {{failed template argument deduction}} + +void (*init_with_exact_type_a)(int) noexcept = redecl4<true>; +void (*init_with_mismatched_type_a)(int) = redecl4<true>; +auto deduce_auto_from_noexcept_function_ptr_a = redecl4<true>; +using DeducedType_a = decltype(deduce_auto_from_noexcept_function_ptr_a); +using DeducedType_a = void (*)(int) noexcept; + +void (*init_with_exact_type_b)(int) = redecl4<false>; +void (*init_with_mismatched_type_b)(int) noexcept = redecl4<false>; // expected-error {{does not match required type}} +auto deduce_auto_from_noexcept_function_ptr_b = redecl4<false>; +using DeducedType_b = decltype(deduce_auto_from_noexcept_function_ptr_b); +using DeducedType_b = void (*)(int); namespace DependentDefaultCtorExceptionSpec { template<typename> struct T { static const bool value = true; }; |

