Opened 12 years ago

Closed 11 years ago

Last modified 10 years ago

#5281 closed Bugs (fixed)

alloc_func typedef in rapidxml.hpp, VC++ compiler can't lookup

Reported by: bolero.murakami+cpp@… Owned by: Sebastian Redl
Milestone: To Be Determined Component: property_tree
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

In VC8~VC10, a compilation error will be occurred when you declare "alloc_func" that can lookup from "boost::property_tree::detail::rapidxml" namespace before including <boost/property_tree/detail/rapidxml.hpp>.

struct alloc_func;
#include <boost/property_tree/detail/rapidxml.hpp>
error C2226: syntax error : unexpected type 'alloc_func' A syntax error occurs before or in the type specifier.

Because the VC++ compiler cause unexpectedly lookup about alloc_func typedef in rapidxml.hpp.

Attachments (1)

rapidxml.patch (1.1 KB ) - added by bolero.murakami+cpp@… 12 years ago.

Download all attachments as: .zip

Change History (8)

by bolero.murakami+cpp@…, 12 years ago

Attachment: rapidxml.patch added

comment:1 by niels_dekker, 11 years ago

FYI, I also encountered this problem. One of the projects I'm involved with uses both <boost/property_tree/xml_parser.hpp> and the toolkit ITK, which includes a file named <zlib.h>. This <zlib.h> has a alloc_func typedef which appears to conflict with the one in xml_parser.hpp. So I would very much appreciate if this issue would be fixed.

comment:2 by Sebastian Redl, 11 years ago

(In [72003]) Try to work around MSVC name lookup bug. See bug 5281.

comment:3 by Sebastian Redl, 11 years ago

I've tried a workaround. Can you please test it?

comment:4 by anonymous, 11 years ago

The work around works for me.

comment:5 by Sebastian Redl, 11 years ago

Resolution: fixed
Status: newclosed

(In [76447]) Merge [72000],[72001],[72003], [74691], [75587], [75589], [75590], and [75593] from trunk. Fixes bug 4840. Fixes bug 5259. Fixes bug 5281, I think. Fixes bug 5944. Fixes bug 5757. Fixes bug 5710. Fixes bug 5307, I think.

comment:6 by trent.waddington@…, 10 years ago

Alternate fix: change all occurrences of alloc_func to alloc_func1.

in reply to:  6 comment:7 by anonymous, 10 years ago

Replying to trent.waddington@…:

Alternate fix: change all occurrences of alloc_func to alloc_func1.

This worked for me in windows. Have not yet tested if the fix works in other OS.

Note: See TracTickets for help on using tickets.