OSDN Git Service

PR c++/49418
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / new10.C
1 // PR c++/46658
2
3 typedef unsigned short int uint16_t;
4 typedef unsigned int uint32_t;
5 template<class T> class scoped_array {
6     void reset(T * p = 0)     { }
7 };
8 typedef uint16_t SequenceIndex;
9 typedef uint32_t SequenceMapIndex;
10 class Analyzer  {
11     template <typename READER>
12         bool ReadDictionary( READER& reader );
13     scoped_array<SequenceIndex> map_from_2_hints_to_composite_sequence;
14     SequenceMapIndex number_of_composite_sequences;
15 };
16 template <typename READER>
17 bool Analyzer::ReadDictionary( READER &reader )
18 {
19   const SequenceMapIndex ntt
20     = ( number_of_composite_sequences + SequenceMapIndex( 1 ) )
21     * ( number_of_composite_sequences + 1 );
22   map_from_2_hints_to_composite_sequence.reset(new SequenceIndex[ntt]());
23 }