<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - trunk libcxx does not build with g++ 9.3.0"
   href="https://bugs.llvm.org/show_bug.cgi?id=51359">51359</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>trunk libcxx does not build with g++ 9.3.0
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>brian.sumner@amd.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Trying a build of a recent monorepo commit with DLLVM_ENABLE_PROJECTS including
libcxx with the standard compiler on my Ubuntu 20.04 system:

$ /usr/bin/c++ --version
c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 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.

results in a build failure.  This appears to be a g++ bug, because the build
sets -std=c++2a, but g++ is complaining that a destructor cannot be constexpr. 
However, if LLVM is supposed to build with gcc > 5.1.0, then libcxx may need to
be fixed.

Here is the build output with the failure:

make[2]: Entering directory '/git/build-llvm'
[ 42%] Building CXX object
projects/libcxx/src/CMakeFiles/cxx_static.dir/optional.cpp.o
cd /git/build-llvm/projects/libcxx/src && /usr/bin/c++ -DNDEBUG -D_DEBUG
-D_GNU_SOURCE -D_LIBCPP_BUILDING_LIBRARY
-D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-I/git/build-llvm/projects/libcxx/src -I/git/llvm-monorepo/libcxx/src
-I/git/build-llvm/include -I/git/llvm-monorepo/llvm/include
-I/git/build-llvm/projects/libcxx/include/c++build -fPIC
-fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall
-Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wno-missing-field-initializers  -Wno-long-long -Wimplicit-fallthrough
-Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move
-Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor
-Wsuggest-override -Wno-comment -Wmisleading-indentation -g -fPIC
-DLIBCXX_BUILDING_LIBCXXABI -nostdinc++ -fvisibility-inlines-hidden -Wall
-Wextra -W -Wwrite-strings -Wno-unused-parameter -Wno-long-long
-Werror=return-type -Wextra-semi -Wundef -Wno-literal-suffix -Wno-c++14-compat
-Wno-noexcept-type -Wno-suggest-override -Wno-error
-I/git/build-llvm/include/c++/v1 -std=c++2a -o
CMakeFiles/cxx_static.dir/optional.cpp.o -c
/git/llvm-monorepo/libcxx/src/optional.cpp
In file included from /git/build-llvm/include/c++/v1/__memory/shared_ptr.h:25,
                 from
/git/build-llvm/include/c++/v1/__functional/function.h:20,
                 from /git/build-llvm/include/c++/v1/functional:500,
                 from /git/build-llvm/include/c++/v1/optional:154,
                 from /git/llvm-monorepo/libcxx/src/optional.cpp:9:
/git/build-llvm/include/c++/v1/__memory/unique_ptr.h:746:50: warning: type
attributes ignored after type is already defined [-Wattributes]
  746 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
      |                                                  ^~~~
In file included from
/git/build-llvm/include/c++/v1/__functional/function.h:20,
                 from /git/build-llvm/include/c++/v1/functional:500,
                 from /git/build-llvm/include/c++/v1/optional:154,
                 from /git/llvm-monorepo/libcxx/src/optional.cpp:9:
/git/build-llvm/include/c++/v1/__memory/shared_ptr.h:1710:50: warning: type
attributes ignored after type is already defined [-Wattributes]
1710 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
      |                                                  ^~~~
In file included from /git/build-llvm/include/c++/v1/__availability:13,
                 from /git/build-llvm/include/c++/v1/optional:149,
                 from /git/llvm-monorepo/libcxx/src/optional.cpp:9:
/git/build-llvm/include/c++/v1/__config:1054:41: error: a destructor cannot be
'constexpr'
1054 | #  define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr
      |                                         ^~~~~~~~~
/git/build-llvm/include/c++/v1/optional:224:5: note: in expansion of macro
'_LIBCPP_CONSTEXPR_AFTER_CXX17'
  224 |     _LIBCPP_CONSTEXPR_AFTER_CXX17 ~__optional_destruct_base()
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>