mismatched dynamic exception specifications in expressions from an error to a warning, since this is no longer ill-formed in C++1z. Allow reference binding of a reference-to-non-noexcept function to a noexcept function lvalue. As defect resolutions, also allow a conditional between noexcept and non-noexcept function lvalues to produce a non-noexcept function lvalue (rather than decaying to a function pointer), and allow function template argument deduction to deduce a reference to non-noexcept function when binding to a noexcept function type. llvm-svn: 284905
11 lines
252 B
C++
11 lines
252 B
C++
// RUN: %clang_cc1 -std=c++1z -verify %s -fcxx-exceptions
|
|
|
|
void (*p)() noexcept;
|
|
void (*q)();
|
|
|
|
void f() {
|
|
// FIXME: This seems like a bad rule.
|
|
p = static_cast<decltype(p)>(q); // expected-error {{not allowed}}
|
|
q = static_cast<decltype(q)>(p);
|
|
}
|