Opened 9 years ago

Closed 9 years ago

#3631 closed Bugs (fixed)

Regex ICU support doesn't compile with #define U_USING_ICU_NAMESPACE 0

Reported by: Matthias Schiffer <matthias@…> Owned by: John Maddock
Milestone: Boost 1.41.0 Component: regex
Version: Boost 1.40.0 Severity: Problem
Keywords: Cc:


To prevent namespace pollution, I definde U_USING_ICU_NAMESPACE to 0 in my projects before including any ICU headers. This prevents the ICU headers from adding a "using namespace icu" to the root namespace, so classes like UnicodeString? are only available in the icu:: namespace.

While most uses of ICU classes in the Boost Regex ICU headers are prepended with U_NAMESPACE_QUALIFIER (e.g. Locale and Collator), this seems to have been forgotten for UnicodeString?, causing the compile to fail.

Minimal example to reproduce and patch attached.

Attachments (2)

icuregex.cpp (275 bytes) - added by Matthias Schiffer <matthias@…> 9 years ago.
Minimal example
boost_regex.patch (7.8 KB) - added by Matthias Schiffer <matthias@…> 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Matthias Schiffer <matthias@…>

Attachment: icuregex.cpp added

Minimal example

Changed 9 years ago by Matthias Schiffer <matthias@…>

Attachment: boost_regex.patch added


comment:1 Changed 9 years ago by John Maddock

Resolution: fixed
Status: newclosed

(In [57739]) Suppress external templates with Mingw32 - it seems to cause issues with dll's. Fix match_results.swap. Add missing namespace qualifiers to ICU code: fixes #3631.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain John Maddock.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.