Modify

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#5281 closed Bugs (fixed)

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

Reported by: bolero.murakami+cpp@… Owned by: cornedbee
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@… 6 years ago.

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by bolero.murakami+cpp@…

comment:1 Changed 6 years ago by niels_dekker

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 Changed 6 years ago by cornedbee

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

comment:3 Changed 6 years ago by cornedbee

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

comment:4 Changed 6 years ago by anonymous

The work around works for me.

comment:5 Changed 5 years ago by cornedbee

  • Resolution set to fixed
  • Status changed from new to closed

(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 follow-up: Changed 5 years ago by trent.waddington@…

Alternate fix: change all occurrences of alloc_func to alloc_func1.

comment:7 in reply to: ↑ 6 Changed 5 years ago by anonymous

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.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain cornedbee.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.