We're updating the issue view to help you get more done. 

ICU4C fails to build with -std=c++17

Description

Steps to reproduce:

1 2 3 4 5 6 7 $ g++ --version g++ (Debian 7.3.0-5) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ CXX=g++ CXXFLAGS=-std=c++17 ./runConfigureICU --enable-debug --disable-release Linux $ make -j6

Example error printed:

1 2 3 4 5 6 7 8 9 10 number_skeletons.cpp: In function ‘icu::number::impl::MacroProps icu::number::impl::skeleton::parseSkeleton(const icu::UnicodeString&, UErrorCode&)’: number_skeletons.cpp:423:38: error: ‘icu::number::Notation::Notation()’ is private within this context if (U_FAILURE(status)) { return {}; } ^ In file included from number_types.h:14:0, from number_skeletons.h:10, from number_skeletons.cpp:13: unicode/numberformatter.h:333:5: note: declared private here Notation() : fType(NTN_SIMPLE), fUnion() {} ^~~~~~~~

I am also able to reproduce a similar error in Clang 6.0.0:

1 2 3 4 5 number_skeletons.cpp:423:38: error: field of type 'icu::number::Notation' has private default constructor if (U_FAILURE(status)) { return {}; } ^ ./unicode/numberformatter.h:333:5: note: declared private here Notation() : fType(NTN_SIMPLE), fUnion() {}

The class calling the default constructor is friended to the class being constructed. Both compilers are fine on `-std=c++11`.

Status

Assignee

Shane Carr

Reporter

Shane Carr

Labels

Reviewer

None

Time Needed

None

Start date

None

Components

Fix versions

Priority

major