lumiera_/research/clang-static-init-1.cpp
Ichthyostega 0e8a1f1e08 bughunt: use a single SingletonSub instance in two compilation units --> HIT
basically this reproduces the problem in a simplified setup.
Especially note that we're going through a single instance of the factory,
yet still this single instance 'sees' two different locations of the
class static variable
2013-10-06 23:17:18 +02:00

28 lines
379 B
C++

#include "lib/test/run.hpp"
#include "clang-static-init.hpp"
#include <iostream>
using ::test::Test;
using std::cout;
using std::endl;
using namespace test;
int
main (int, char**)
{
cout << "\n.gulp.\n";
Subject& ref1 = fab();
Subject& sub2 = test::fabricate();
cout << "sub1="<< &ref1 << " sub2="<< &sub2 <<"\n";
return 0;
}