libstdc++-v3/testsuite/20_util/any/misc/lwg3305.cc
raw| 1 | // { dg-do compile { target c++17 } } |
| 2 | |
| 3 | // LWG 3305. any_cast<void> |
| 4 | |
| 5 | #include <any> |
| 6 | |
| 7 | void |
| 8 | test_lwg3305() |
| 9 | { |
| 10 | std::any a; |
| 11 | (void) std::any_cast<const void>(&a); // { dg-error "here" } |
| 12 | const std::any a2; |
| 13 | (void) std::any_cast<volatile void>(&a2); // { dg-error "here" } |
| 14 | } |
| 15 | // { dg-error "static assertion failed" "" { target *-*-* } 0 } |