throw_exception_fail.cpp 454 B

123456789101112131415161718
  1. //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include <boost/throw_exception.hpp>
  5. struct
  6. my_exception
  7. {
  8. };
  9. void
  10. tester()
  11. {
  12. //Must not compile, throw_exception requires exception types to derive std::exception.
  13. boost::throw_exception(my_exception());
  14. }