khoarus / rapidjson

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

can't compile with gcc (4.6.3) or clang (3.0) #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. compile the file 'bug.cpp' included below.
2. Seems related to the member template function in a template class, this is 
more like my code structure - the first attempt at a bugrep compiled OK though.
3. Tests were on recent Ubuntu, but I first noticed on mingw64 gcc (4.6.1)

What is the expected output? What do you see instead?
Outputs from the compilations included.

What version of the product are you using? On what operating system?
svn r64

Please provide any additional information below.

Seems happy in latest beta Visual Studio.  Bit of a blocker though for me.

Original issue reported on code.google.com by jman11...@gmail.com on 5 Aug 2012 at 11:07

Attachments:

GoogleCodeExporter commented 8 years ago
Your line 38:
    gr.Parse<kParseDefaultFlags, Stream, Handler>(stream, handler) ;
This is invalid C++. You need to help the greedy parser understand that the "<" 
in this case is a template parameter list, not a less-than operator. Change 
your code to
    gr.template Parse<kParseDefaultFlags, Stream, Handler>(stream, handler) ;
and then it will work.

For a similar bug in rapidjson itself, see bug 30.

Original comment by art...@push.am on 16 Oct 2012 at 10:02

GoogleCodeExporter commented 8 years ago
Thanks Arthur for your answer.

Original comment by milo...@gmail.com on 14 Nov 2012 at 3:55