pool_msvc_compiler_bug_test.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright (C) 2008 Jurko Gospodnetic
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See
  4. // accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. // This tests whether the Boost Pool library managed to get a regression and
  7. // hit the MSVC 'variables exported to global namespace' bug again. This bug
  8. // affects at least MSVC 7.1 & 8.0 releases and has been fixed in the MSVC 9.0
  9. // release.
  10. //
  11. // If the bug exists this test should fail to compile, complaining about an
  12. // ambiguous CRITICAL_SECTION symbol. The bug got fixed by making the boost/
  13. // /pool/detail/mutex.hpp header reference all Windows API constants using their
  14. // fully qualified names.
  15. //
  16. // To see the bug in action without using any Boost libraries run the
  17. // following program:
  18. //
  19. // namespace One { class Brick; }
  20. // namespace Two
  21. // {
  22. // using namespace One;
  23. // template <class TinyTemplateParam> class TinyClass {};
  24. // }
  25. // class Brick {};
  26. // Brick brick;
  27. // int main() {}
  28. // (17.04.2008.) (Jurko)
  29. #include "boost/archive/text_iarchive.hpp"
  30. #include "boost/pool/detail/mutex.hpp"
  31. // Including "boost/pool/pool_alloc.hpp" instead of mutex.hpp should work as
  32. // well.
  33. int main()
  34. {
  35. }