Namespace error breaks Cygwin build

Description

Building ICU-63.1 on Cygwin fails with the following error:

icu/source/i18n/unicode/numberrangeformatter.h:189:33: error: explicit instantiation of ‘struct std::atomic<icu_63::number::impl::NumberRangeFormatterImpl*>’ in namespace ‘icu_63::number’ (which does not enclose namespace ‘std’) [-fpermissive]
template struct U_I18N_API std::atomic<impl::NumberRangeFormatterImpl*>;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This problem started with the following commit:

commit ba001f46163ded5886972aeb927e35756f00d761
Author: Jeff Genovy <29107334+jefgen@users.noreply.github.com>
Date: Fri Oct 5 10:44:52 2018 -0700

Fix MSVC/clang compiler warning C4251, export explicit template, required for building DLLs on Windows. Also fix a few other warnings as well.

My C++ knowledge isn't good enough to understand what this is all about, but there's an obvious fix, for which I'll submit a PR.

Activity

Show:
Ken Brown
October 16, 2018, 7:06 PM

Yes.

Jeff Genovy
October 16, 2018, 7:13 PM
Edited

Thanks.
I think this should likely be listed as a "known issue" on the ICU v63 download page, and then we can merge the fix into the maint-63 branch once the fix is in master. (I will wait until the ICU-TC discussion tomorrow first though.)

André Bargull
October 17, 2018, 10:16 AM

See also ICU-20209.

The current Firefox patches at https://bugzilla.mozilla.org/show_bug.cgi?id=1499026 disable the explicit instantiation for MinGW, too. So maybe it's possible to change the overall condition to U_PF_WINDOWS == U_PLATFORM?

Anonymous
October 24, 2018, 6:31 PM

A similar bug fix is needed for Mingw-w64 builds.
https://github.com/stweil/icu/commit/88eacd2ce70106c2818d81758092fd525500874e contains more details and a patch.

Jeff Genovy
October 24, 2018, 7:05 PM

Thank you for the report stweil

Note: There is some related discussion on the other issue/ticket that is similar to your patch.

Fixed

Assignee

Jeff Genovy

Reporter

Ken Brown

Components

Labels

Reviewer

None

Priority

major

Time Needed

None

Fix versions

Configure