llvm-for-llvmta/tools/clang/test/CXX/expr/expr.post/expr.static.cast/p7.cpp

11 lines
252 B
C++
Raw Normal View History

2022-04-25 13:02:35 +02:00
// 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);
}