diff options
Diffstat (limited to 'ld/testsuite/ld-elf/pr12730.cc')
-rw-r--r-- | ld/testsuite/ld-elf/pr12730.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr12730.cc b/ld/testsuite/ld-elf/pr12730.cc new file mode 100644 index 0000000..69f57f9 --- /dev/null +++ b/ld/testsuite/ld-elf/pr12730.cc @@ -0,0 +1,38 @@ +#include <iostream> + +class Hello +{ +public: + Hello () + {} + + ~Hello () + {} + + void act () + { std::cout << "Hello, world!" << std::endl; } +}; + + +template <class T> +struct Foo +{ + T* _M_allocate_single_object () + { + return new T; + } +}; + +static void __attribute__ (( constructor )) PWLIB_StaticLoader() { + Foo<Hello> allocator; + Hello* salut = allocator._M_allocate_single_object (); + salut->act (); +} + + +int +main (int /*argc*/, + char* /*argv*/[]) +{ + return 0; +} |