problem about generating data section in g++ 4.2

2007-07-19 Thread Ling-hua Tseng
Here is the example program: == // test.cxx #include #include namespace { template struct transformValue { size_t operator()(const T &x) const { return x + 10; } }; } extern std::map > *test; std::map > *test; == If I compile this file with g++ 4.2 by the f

Re: problem about generating data section in g++ 4.2

2007-07-19 Thread Brian Dessent
Ling-hua Tseng wrote: > If I compile this file with g++ 4.2 by the following command: > g++ -c test.cxx > and then use this command to check symbol: > nm test.o > I cannot find the global varible `test' in symbol table: This was an intentional change as part of the overhaul of C++ visibility

Re: problem about generating data section in g++ 4.2

2007-07-19 Thread Ling-hua Tseng
Thanks a lot. I also found a warning message about this if I used the `bridge pattern' (aka pimpl idiom) in my code. For example, here are 2 files: == // interface.hxx #include struct TestImpl; class Test { public: Test(); ~Test(); void foo(); private: std: