Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue May 17, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 10 Jan 2015 at 10:17

@GoogleCodeExporter
Copy link
Author

Please check if the version at https://github.com/miloyip/rapidjson fixes your 
problem.

Original comment by [email protected] on 10 Jan 2015 at 6:08

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 12 Jan 2015 at 6:39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant