1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <class charT, class traits = char_traits<charT> >
13 // class basic_ostream::sentry;
20 #include "test_macros.h"
24 template <class CharT>
26 : public std::basic_streambuf<CharT>
42 std::ostream os((std::streambuf*)0);
43 std::ostream::sentry s(os);
46 assert(sync_called == 0);
50 std::ostream::sentry s(os);
53 assert(sync_called == 0);
57 std::ostream::sentry s(os);
61 assert(sync_called == 1);
62 #ifndef TEST_HAS_NO_EXCEPTIONS
68 std::ostream::sentry s(os);
76 assert(sync_called == 1);