// { dg-do compile { target c++17 } } // LWG 3305. any_cast #include void test_lwg3305() { std::any a; (void) std::any_cast(&a); // { dg-error "here" } const std::any a2; (void) std::any_cast(&a2); // { dg-error "here" } } // { dg-error "static assertion failed" "" { target *-*-* } 0 }