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

            Bug ID: 85792
           Summary: #include <variant> triggers Wctor-dtor-privcay
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sshannin at gmail dot com
  Target Milestone: ---

seth@dev9:~$ cat tmp.cpp
#include <variant>

seth@dev9:~$ /build/toolchain13/bin/g++ tmp.cpp -Wctor-dtor-privacy -std=c++17
-c
In file included from tmp.cpp:1:
/build/toolchain13/include/c++/8.1.0/variant:463:7: note:
‘std::__detail::__variant::_Copy_ctor_base<<anonymous>,
_Types>::_Copy_ctor_base(const
std::__detail::__variant::_Copy_ctor_base<<anonymous>, _Types>&)’ is public,
but requires an existing ‘struct
std::__detail::__variant::_Copy_ctor_base<<anonymous>, _Types>’ object
       _Copy_ctor_base(const _Copy_ctor_base& __rhs)
       ^~~~~~~~~~~~~~~
/build/toolchain13/include/c++/8.1.0/variant:497:7: note:
‘std::__detail::__variant::_Move_ctor_base<<anonymous>,
_Types>::_Move_ctor_base(std::__detail::__variant::_Move_ctor_base<<anonymous>,
_Types>&&)’ is public, but requires an existing ‘struct
std::__detail::__variant::_Move_ctor_base<<anonymous>, _Types>’ object
       _Move_ctor_base(_Move_ctor_base&& __rhs)
       ^~~~~~~~~~~~~~~
/build/toolchain13/include/c++/8.1.0/variant:562:7: note:
‘std::__detail::__variant::_Copy_assign_base<<anonymous>,
_Types>::_Copy_assign_base(const
std::__detail::__variant::_Copy_assign_base<<anonymous>, _Types>&)’ is public,
but requires an existing ‘struct
std::__detail::__variant::_Copy_assign_base<<anonymous>, _Types>’ object
       _Copy_assign_base(const _Copy_assign_base&) = default;
       ^~~~~~~~~~~~~~~~~
/build/toolchain13/include/c++/8.1.0/variant:631:7: note:
‘std::__detail::__variant::_Move_assign_base<<anonymous>,
_Types>::_Move_assign_base(const
std::__detail::__variant::_Move_assign_base<<anonymous>, _Types>&)’ is public,
but requires an existing ‘struct
std::__detail::__variant::_Move_assign_base<<anonymous>, _Types>’ object
       _Move_assign_base(const _Move_assign_base&) = default;
       ^~~~~~~~~~~~~~~~~

seth@dev9:~$ /build/toolchain13/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/build/toolchain13/bin/g++
COLLECT_LTO_WRAPPER=/build/toolchain13/libexec/gcc/x86_64-pc-linux-gnu/8.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc_8_1_0/configure --prefix=/build/toolchain13
--enable-languages=c,c++ --enable-lto --disable-plugin --program-suffix=-8.1.0
--disable-multilib --disable-shared
Thread model: posix
gcc version 8.1.0 (GCC) 
seth@dev9:~$

Reply via email to