teris / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

reader.h compiler errors clang (use 'template' keyword to treat 'Stack' as a dependent template name) #118

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Using compiler: 
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

On Mac OSX.

Following compilation errors are listed:
../rapidjson/reader.h:627:23: error: use 'template' keyword to treat 'Stack' as 
a dependent template name
(*((stack_).internal::Stack< StackAllocator> ::template Push< CharType> ())) = 
c;
                      ^
                      template 
../rapidjson/reader.h:632:28: error: use 'template' keyword to treat 'Stack' as 
a dependent template name
return ((stack_).internal::Stack< StackAllocator> ::template Pop< CharType> 
(length_));
                           ^
                           template 
../rapidjson/reader.h:1258:23: error: use 'template' keyword to treat 'Stack' 
as a dependent template name
(*((stack_).internal::Stack< StackAllocator> ::template Push< SizeType> (1))) = 
n;
                      ^
                      template 
../rapidjson/reader.h:1260:23: error: use 'template' keyword to treat 'Stack' 
as a dependent template name
(*((stack_).internal::Stack< StackAllocator> ::template Push< SizeType> (1))) = 
0;
                      ^
                      template 
../rapidjson/reader.h:1309:23: error: use 'template' keyword to treat 'Stack' 
as a dependent template name
(*((stack_).internal::Stack< StackAllocator> ::template Top< SizeType> ())) = 
((*((stack_).internal::Stack< StackAllocator> ::template Top< SizeType> ())) + 
1);
                      ^
                      template 
../rapidjson/reader.h:1309:102: error: use 'template' keyword to treat 'Stack' 
as a dependent template name
(*((stack_).internal::Stack< StackAllocator> ::template Top< SizeType> ())) = 
((*((stack_).internal::Stack< StackAllocator> ::template Top< SizeType> ())) + 
1);
                                                                                                     ^
                                                                                                     template 
../rapidjson/reader.h:1315:35: error: use 'template' keyword to treat 'Stack' 
as a dependent template name
SizeType c = *((stack_).internal::Stack< StackAllocator> ::template Pop< 
SizeType> (1));
                                  ^
                                  template 
../rapidjson/reader.h:1320:85: error: use 'template' keyword to treat 'Stack' 
as a dependent template name
IterativeParsingState n = static_cast< 
IterativeParsingState>((*((stack_).internal::Stack< StackAllocator> ::template 
Pop< SizeType> (1))));
                                                                                    ^
                                                                                    template 
../rapidjson/reader.h:1340:35: error: use 'template' keyword to treat 'Stack' 
as a dependent template name
SizeType c = *((stack_).internal::Stack< StackAllocator> ::template Pop< 
SizeType> (1));
                                  ^
                                  template 
../rapidjson/reader.h:1345:85: error: use 'template' keyword to treat 'Stack' 
as a dependent template name
IterativeParsingState n = static_cast< 
IterativeParsingState>((*((stack_).internal::Stack< StackAllocator> ::template 
Pop< SizeType> (1))));
                                                                                    ^
                                                                                    template 
10 errors generated.

At first glance I don't see anything wrong in the code. Moreover document.h 
uses also the Stack template class operations where these errors are not an 
issue..

Original issue reported on code.google.com by polly...@gmail.com on 10 Jan 2015 at 10:17

GoogleCodeExporter commented 8 years ago
Please check if the version at https://github.com/miloyip/rapidjson fixes your 
problem.

Original comment by milo...@gmail.com on 10 Jan 2015 at 6:08

GoogleCodeExporter commented 8 years ago
That's the version I used (latest version from github).
I've found a workaround by removing the 'internal' namespace for the class
Stack.

Original comment by polly...@gmail.com on 12 Jan 2015 at 6:39