https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69321

            Bug ID: 69321
           Summary: Error on use of non-copyable type with any_cast
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kaballo86 at hotmail dot com
  Target Milestone: ---

The following snippet fails with an error due to use of a deleted function:

    #include <experimental/any>

    struct noncopyable {
      noncopyable(noncopyable const&) = delete;
    };

    int main() {
      std::experimental::any a;
      std::experimental::any_cast<noncopyable>(&a);
    }

The `any_cast` overloads taking pointers have no requirements, so this should
compile and return `nullptr` instead.

Reply via email to