https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78139

            Bug ID: 78139
           Summary: [7 regression][c++1z] inaccessible destructor required
                    in new expression
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lucdanton at free dot fr
  Target Milestone: ---

While trying to compile Boost.Locale with trunk in C++1z mode I ran into the
following regression (simplified):

    // error: 'std::__cxx11::collate_byname<_CharT>::~collate_byname() [with
_CharT = char]' is protected within this context
    std::locale loc2 = std::locale(std::locale(),
                                   new std::collate_byname<char>(""));

I tried to convert it to a minimal testcase to bisect the regression but
unfortunately I unwittingly ran into PR57082. Using a not-so-minimal testcase
instead, I bisected to r240889. The program:

//----------
#include <locale>

int main()
{
    // all fine
    std::locale loc0(std::locale(), new std::collate_byname<char>(""));
    std::locale loc1 = { std::locale(), new std::collate_byname<char>("") };

    // error: 'std::__cxx11::collate_byname<_CharT>::~collate_byname() [with
_CharT = char]' is protected within this context
    std::locale loc2 = std::locale(std::locale(), new
std::collate_byname<char>(""));
}

Reply via email to