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

            Bug ID: 78326
           Summary: incorrect c++ usage in experimental/vector and others?
                    _X_max_align is inaccessible
           Product: gcc
           Version: 6.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mib.bugzilla at gmail dot com
  Target Milestone: ---

Hello, I work for Intel on the Intel c++ compiler and our compiler uses the g++
headers when we are compiling on Linux host.  When we compile the
experimental/vector file we are finding a programming problem.  We've also
compiled this construct using the Microsoft visual studio compiler and the
clang compiler, those compilers likewise are not able to process this
construct.

Here's what our compiler reports:
include/c++/6.2.0/experimental/memory_resource(284): error #308: member
"std::experimental::fundamentals_v2::pmr::memory_resource::_S_max_align"
(declared at line 74) is inaccessible
                                            __alignment : _S_max_align);
                                                          ^
          detected during instantiation of "void
*std::experimental::fundamentals_v2::pmr::__resource_adaptor_imp<_Alloc>::do_allocate(std::size_t={unsigned
long}, std::size_t={unsigned long}) [with _Alloc=std::allocator<char>]" 

Using creduce, we created this smaller test case:

icpc -c vecE.cpp -w

vecE.cpp(14): error #308: member "C::_S_max_align" (declared at line 10) is
inaccessible
          size_t __new_size = _S_max_align;
                                    ^
          detected during instantiation of "void *D<<unnamed>>::m_fn1() [with
<unnamed>=B::rebind_alloc<int>]"

compilation aborted for vecE.cpp (code 2)
-bash-4.2$ cat !$
cat vecE.cpp
typedef int size_t;
class A;
struct B {
    template < typename > using rebind_alloc = A;
};
template < typename > class D;
template < typename > using resource_adaptor = D < B::rebind_alloc < int >>;
class C {
    static constexpr size_t
    _S_max_align = 0;
};
template < typename > class D:C {
    virtual void * m_fn1 () {
        size_t __new_size = _S_max_align;
    }
};
resource_adaptor < A > __get_default_resource___r;

What do you think, is it possible you could correct this? We see the same
diagnostic in experimental/unordered_set, unordered_map, string, set, regex,
memory_resource, map, list, forward_list, dequeue

Thanks and regards, Melanie Blower

Reply via email to