Ticket #13481: bug.cpp

File bug.cpp, 376 bytes (added by Piotr Podusowski <piotr.podusowski@…>, 5 years ago)
Line 
1#include <iostream>
2#include "boost/function.hpp"
3
4struct LogBuffer : public std::streambuf
5{
6 char m_buf[222];
7};
8
9struct Fun
10{
11 void operator()()
12 {
13 if (i != 5)
14 {
15 abort();
16 }
17 }
18 int i;
19};
20
21void x()
22{
23 boost::function<void()> f;
24 f = Fun{5};
25 LogBuffer c;
26 f();
27}
28
29int main(int argc, char *argv[])
30{
31 x();
32}
33