lumiera_/research/clang-static-init-2.cpp
Ichthyostega 10a511d29c bughunt: build testcase statically linked
...but still dynamically linking against the core lib
But the actual template instantiations happen now within the two
compilation units, which are linked statically.

When looking into the symbol table, we can see that the static
field is emitted two times

readelf -W target/clang-static-init -s | c++filt |less
2013-10-06 23:17:18 +02:00

35 lines
421 B
C++

#include "clang-static-init.hpp"
#include <iostream>
using proc::ConfigResolver;
using std::cout;
using std::endl;
namespace test {
int Subject::cnt = 0;
Subject::Subject()
{
++cnt;
std::cout << "Subject("<<cnt<<")\n";
}
namespace {
Holder<Subject> fab2;
}
ConfigResolver&
fabricate()
{
return ConfigResolver::instance();
}
} // namespace test