Closed GoogleCodeExporter closed 9 years ago
I run into exactly the same issue. Here's the code and error:
#import "document.h" // Objective-C++
Document document;
char* buffer = NULL; // initialized somewhere else
if (document.ParseInsitu<0>(buffer).HasParseError())
{
return;
}
////////////////////////////////
Error reported:
/Users/zhaojianyin2012/Dev/Feedzr2/Feedzr/rapidjson/document.h:704:7: Reference
to non-static member function must be called
/Users/zhaojianyin2012/Dev/Feedzr2/Feedzr/GoogleEngine.mm:26:9: In file
included from
/Users/zhaojianyin2012/Dev/Feedzr2/Feedzr/Feedzr/../GoogleEngine.mm:26:
/Users/zhaojianyin2012/Dev/Feedzr2/Feedzr/rapidjson/document.h:726:10: In
instantiation of function template specialization
'rapidjson::GenericDocument<rapidjson::UTF8<char>,
rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::ParseStream<1,
rapidjson::UTF8<char>,
rapidjson::GenericInsituStringStream<rapidjson::UTF8<char>> >' requested here
/Users/zhaojianyin2012/Dev/Feedzr2/Feedzr/rapidjson/document.h:731:10: In
instantiation of function template specialization
'rapidjson::GenericDocument<rapidjson::UTF8<char>,
rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::ParseInsitu<0,
rapidjson::UTF8<char> >' requested here
/Users/zhaojianyin2012/Dev/Feedzr2/Feedzr/GoogleEngine.mm:774:22: In
instantiation of function template specialization
'rapidjson::GenericDocument<rapidjson::UTF8<char>,
rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >::ParseInsitu<0>'
requested here
Original comment by zhaojian...@gmail.com
on 7 Aug 2012 at 6:42
I find out that by changing Line:703
from:
GenericReader<SourceEncoding, Encoding> reader;
to:
GenericReader<rapidjson::UTF8<char>, rapidjson::UTF8<char>> reader;
will silent the clang complier from reporting error.
Original comment by zhaojian...@gmail.com
on 8 Aug 2012 at 10:11
I have fixed the same problem by replacing
(apidjson/include/rapidjson/document.h:704)
"if (reader.Parse<parseFlags>(is, *this)) {"
with:
"if (reader.template Parse<parseFlags>(is, *this)) {"
Original comment by m.neg...@gmail.com
on 28 Aug 2012 at 9:35
m.negram's suggested patch is 100% correct; we've independently come up with
the same patch ourselves. Could some maintainer please apply it to trunk?
Original comment by art...@push.am
on 16 Oct 2012 at 9:58
This issue was closed by revision r70.
Original comment by milo...@gmail.com
on 13 Nov 2012 at 9:46
This issue was closed by revision r71.
Original comment by milo...@gmail.com
on 13 Nov 2012 at 9:48
This issue was closed by revision 22ddf37cf094.
Original comment by milo...@gmail.com
on 6 Jun 2014 at 6:04
Original issue reported on code.google.com by
ed.bart...@gmail.com
on 26 Jul 2012 at 1:45