| 1 |
// { dg-additional-options "-fmodules-ts -Wno-pedantic" } |
| 2 |
|
| 3 |
module; |
| 4 |
# 5 __FILE__ 1 |
| 5 |
class Pooh; |
| 6 |
class Piglet; |
| 7 |
# 8 "" 2 |
| 8 |
|
| 9 |
export module std; // might happen, you can't say it won't! |
| 10 |
// { dg-module-cmi std } |
| 11 |
|
| 12 |
namespace std { |
| 13 |
export template<typename T> class allocator { |
| 14 |
// just for testing, not real! |
| 15 |
void M (T *); |
| 16 |
template <typename U> U *N (T *); |
| 17 |
}; |
| 18 |
|
| 19 |
template<typename T> void allocator<T>::M (T *) {} |
| 20 |
template<typename T> template<typename U> U *allocator<T>::N (T *) { |
| 21 |
return nullptr; |
| 22 |
} |
| 23 |
|
| 24 |
template void allocator<int>::M (int *); |
| 25 |
template float *allocator<int>::N<float> (int *); |
| 26 |
} |
| 27 |
|
| 28 |
template void std::allocator<Pooh>::M (Pooh *); |
| 29 |
template Piglet *std::allocator<Pooh>::N<Piglet> (Pooh *); |
| 30 |
|
| 31 |
// { dg-final { scan-assembler {_ZNStW3std9allocatorIiE1MEPi:} } } |
| 32 |
// { dg-final { scan-assembler {_ZNStW3std9allocatorIiE1NIfEEPT_Pi:} } } |
| 33 |
// { dg-final { scan-assembler {_ZNStW3std9allocatorI4PoohE1MEPS1_:} } } |
| 34 |
// { dg-final { scan-assembler {_ZNStW3std9allocatorI4PoohE1NI6PigletEEPT_PS1_:} } } |