[llvm-bugs] [Bug 50928] New: Fatal error g++ (GCC) 12.0.0 20210625 in APFloat.h

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 28 09:55:07 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50928

            Bug ID: 50928
           Summary: Fatal error g++ (GCC) 12.0.0 20210625 in APFloat.h
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: dr.duncan.p.simpson at gmx.com
                CC: llvm-bugs at lists.llvm.org

Building llvm with g++ (GCC) 12.0.0 20210625 (experimental) fails due to:
[  0%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/APFixedPoint.cpp.o
In file included from /usr/local/include/c++/12.0.0/memory:76,
                 from
/home/dps/src/llvm/llvm-project/llvm/include/llvm/ADT/SmallVector.h:29,
                 from
/home/dps/src/llvm/llvm-project/llvm/include/llvm/ADT/SmallString.h:16,
                 from
/home/dps/src/llvm/llvm-project/llvm/include/llvm/ADT/APFixedPoint.h:20,
                 from
/home/dps/src/llvm/llvm-project/llvm/lib/Support/APFixedPoint.cpp:14:
/usr/local/include/c++/12.0.0/bits/unique_ptr.h: In instantiation of ‘typename
std::add_lvalue_reference<_Tp>::type std::unique_ptr<_Tp [],
_Dp>::operator[](std::size_t) const [with _Tp = llvm::APFloat; _Dp =
std::default_delete<llvm::APFloat []>; typename
std::add_lvalue_reference<_Tp>::type = llvm::APFloat&; std::size_t = long
unsigned int]’:
/home/dps/src/llvm/llvm-project/llvm/include/llvm/ADT/APFloat.h:634:40: 
required from here
/usr/local/include/c++/12.0.0/bits/unique_ptr.h:658:48: error: invalid use of
incomplete type ‘class llvm::APFloat’
  658 | noexcept(noexcept(std::declval<pointer>()[std::declval<size_t&>()]))
      |                         ~~~~~~~~~~~~~~~~~~~~~~~^
In file included from
/home/dps/src/llvm/llvm-project/llvm/lib/Support/APFixedPoint.cpp:14:
/home/dps/src/llvm/llvm-project/llvm/include/llvm/ADT/APFixedPoint.h:25:7:
note: forward declaration of ‘class llvm::APFloat’
   25 | class APFloat;
      |       ^~~~~~~ 

I think this is probably an issue with the llvm source code and not a g++ bug.
g++ 10 seems to accept this code so presumably what changed is what counts as
instantiation. I would suggest that instead of using getFirst it would be
simpler to make getIEEE a virtual method but that might be a larger change.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210628/20a55ad9/attachment.html>


More information about the llvm-bugs mailing list