Clang Project

clang_source_code/test/CXX/expr/expr.post/expr.static.cast/p7.cpp
1// RUN: %clang_cc1 -std=c++1z -verify %s -fcxx-exceptions
2
3void (*p)() noexcept;
4void (*q)();
5
6void f() {
7  // FIXME: This seems like a bad rule.
8  p = static_cast<decltype(p)>(q); // expected-error {{not allowed}}
9  q = static_cast<decltype(q)>(p);
10}
11