gcc/testsuite/g++.old-deja/g++.robertl/eb60.C
raw| 1 | // { dg-do assemble } |
| 2 | // { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } |
| 3 | #include <string> |
| 4 | |
| 5 | class t { |
| 6 | public: |
| 7 | t(const std::string& s) : s_(s) {} |
| 8 | std::string s_; |
| 9 | static t* t_; |
| 10 | }; |
| 11 | |
| 12 | t* t::t_; |
| 13 | |
| 14 | t* makeT() |
| 15 | { |
| 16 | return new t("test"); |
| 17 | return t::t_ ? t::t_ : |
| 18 | t::t_ = new t("test"); |
| 19 | } |