Modify

Ticket #5281 (closed Bugs: fixed)

Opened 3 years ago

Last modified 21 months ago

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

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

Change History

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

comment:1 Changed 3 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 3 years ago by cornedbee

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

comment:3 Changed 3 years ago by cornedbee

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

comment:4 Changed 3 years ago by anonymous

The work around works for me.

comment:5 Changed 2 years ago by cornedbee

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

(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: ↓ 7 Changed 22 months ago by trent.waddington@…

Alternate fix: change all occurrences of alloc_func to alloc_func1.

comment:7 in reply to: ↑ 6 Changed 21 months 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.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
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.