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

--- Comment #9 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Unfortunately llvm still fails to build:

FAILED: /var/tmp/gcc_test/usr/local/bin/g++   -DGTEST_HAS_RTTI=0
-DLLVMCodeGen_EXPORTS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -fvisibility-inlines-hidden
-Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers
-pedantic -Wno-long-long -Wno-maybe-uninitialized -Wnon-virtual-dtor
-Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O2  -DNDEBUG -pipe
-fPIC -Ilib/CodeGen -I/var/tmp/llvm-project/llvm/lib/CodeGen -Iinclude
-I/var/tmp/llvm-project/llvm/include    -fno-exceptions -fno-rtti -MMD -MT
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineFunctionAnalysis.cpp.o -MF
"lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineFunctionAnalysis.cpp.o.d" -o
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineFunctionAnalysis.cpp.o -c
/var/tmp/llvm-project/llvm/lib/CodeGen/MachineFunctionAnalysis.cpp
In file included from
/var/tmp/gcc_test/usr/local/include/c++/4.10.0/memory:81:0,
                 from
/var/tmp/llvm-project/llvm/include/llvm/ADT/SmallVector.h:28,
                 from
/var/tmp/llvm-project/llvm/include/llvm/Support/Allocator.h:24,
                 from
/var/tmp/llvm-project/llvm/include/llvm/ADT/StringMap.h:18,
                 from
/var/tmp/llvm-project/llvm/include/llvm/PassRegistry.h:23,
                 from /var/tmp/llvm-project/llvm/include/llvm/PassSupport.h:27,
                 from /var/tmp/llvm-project/llvm/include/llvm/Pass.h:377,
                 from
/var/tmp/llvm-project/llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h:17,
                 from
/var/tmp/llvm-project/llvm/lib/CodeGen/MachineFunctionAnalysis.cpp:14:
/var/tmp/gcc_test/usr/local/include/c++/4.10.0/bits/unique_ptr.h: In
instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with
_Tp = llvm::GCStrategy]’:
/var/tmp/gcc_test/usr/local/include/c++/4.10.0/bits/unique_ptr.h:236:16:  
required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp =
llvm::GCStrategy; _Dp = std::default_delete<llvm::GCStrategy>]’
/var/tmp/gcc_test/usr/local/include/c++/4.10.0/bits/stl_construct.h:93:7:  
required from ‘void std::_Destroy(_Tp*) [with _Tp =
std::unique_ptr<llvm::GCStrategy>]’
/var/tmp/gcc_test/usr/local/include/c++/4.10.0/bits/stl_construct.h:103:46:  
required from ‘static void std::_Destroy_aux<<anonymous>
>::__destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator =
std::unique_ptr<llvm::GCStrategy>*; bool <anonymous> = false]’
/var/tmp/gcc_test/usr/local/include/c++/4.10.0/bits/stl_construct.h:127:27:  
required from ‘void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
_ForwardIterator = std::unique_ptr<llvm::GCStrategy>*]’
/var/tmp/gcc_test/usr/local/include/c++/4.10.0/bits/stl_construct.h:151:31:  
required from ‘void std::_Destroy(_ForwardIterator, _ForwardIterator,
std::allocator<_T2>&) [with _ForwardIterator =
std::unique_ptr<llvm::GCStrategy>*; _Tp = std::unique_ptr<llvm::GCStrategy>]’
/var/tmp/gcc_test/usr/local/include/c++/4.10.0/bits/stl_vector.h:425:30:  
required from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp =
std::unique_ptr<llvm::GCStrategy>; _Alloc =
std::allocator<std::unique_ptr<llvm::GCStrategy> >]’
/var/tmp/llvm-project/llvm/include/llvm/CodeGen/GCMetadata.h:166:9:   required
from here
/var/tmp/gcc_test/usr/local/include/c++/4.10.0/bits/unique_ptr.h:74:22: error:
invalid application of ‘sizeof’ to incomplete type ‘llvm::GCStrategy’
  static_assert(sizeof(_Tp)>0,
                      ^

markus@x4 llvm_build % cat MachineFunctionAnalysis.ii                          
                                                                               
                                                                               
                              [25/7733]
template <typename _Tp> _Tp *__addressof (_Tp &);
template <typename _Tp> struct integral_constant
{
  static constexpr _Tp value = 0;
};
template <typename...> struct __and_;
template <typename _B1> struct __and_<_B1> : _B1
{
};
template <typename> struct G : integral_constant<int>
{
};
template <int> struct H
{
  typedef int type;
};
template <typename... _Cond>
using _Require = typename H<__and_<_Cond...>::value>::type;
template <typename> class unique_ptr;
class new_allocator
{
};
template <typename> using __allocator_base = new_allocator;
template <typename> class allocator : __allocator_base<unique_ptr<int> >
{
};
class ModulePass
{
public:
  virtual ~ModulePass ();
};
template <typename _Alloc> struct allocator_traits
{
  static unique_ptr<int> *_S_pointer_helper (...);
  typedef decltype(_S_pointer_helper ()) __pointer;
  typedef __pointer pointer;
  struct B
  {
    template <typename> static integral_constant<int> __test (...);
    using type = decltype(__test<_Alloc>);
  };
  template <typename> using __has_destroy = typename B::type;
  template <typename _Tp>
  static _Require<G<__has_destroy<_Tp> > >
  _S_destroy (allocator<unique_ptr<int> > &, _Tp *p2)
  {
    p2->~_Tp ();
  }
  template <class _Tp>
  static void destroy (allocator<unique_ptr<int> > &p1, _Tp *p2)
  {
    _S_destroy (p1, p2);
  }
};

template <typename>
struct __alloc_traits : allocator_traits<allocator<unique_ptr<int> > >
{
};
template <typename _ForwardIterator, typename _Allocator>
void _Destroy (_ForwardIterator p1, _ForwardIterator, _Allocator &p3)
{
  __alloc_traits<_Allocator>::destroy (p3, __addressof (*p1));
}

template <typename> struct _Vector_base
{
  typedef allocator<unique_ptr<int> > _Tp_alloc_type;
  typedef __alloc_traits<_Tp_alloc_type>::pointer pointer;
  struct D
  {
    pointer _M_start;
    pointer _M_finish;
  };
  _Tp_alloc_type &_M_get_Tp_allocator ();
  D _M_impl;
};
template <typename> class vector : _Vector_base<allocator<unique_ptr<int> > >
{
public:
  ~vector ()
  {
  std:
    _Destroy (this->_M_impl._M_start, this->_M_impl._M_finish,
              _M_get_Tp_allocator ());
  }
};
template <typename _Tp> struct F
{
  void operator()(_Tp *) { sizeof(_Tp); }
};
class A;
template <typename> class unique_ptr
{
  class C
  {
    template <typename> static A *__test (...);
    typedef F<int> _Del;

  public:
    typedef decltype(__test<_Del>()) type;
  };

public:
  typename C::type pointer;
  ~unique_ptr () { get_deleter ()(0); }
  F<A> &get_deleter ();
};

class I : ModulePass
{
  vector<unique_ptr<int> > StrategyList;
};
markus@x4 llvm_build % g++ -c -std=c++11 -O2 MachineFunctionAnalysis.ii
MachineFunctionAnalysis.ii: In instantiation of ‘void F<_Tp>::operator()(_Tp*)
[with _Tp = A]’:
MachineFunctionAnalysis.ii:106:33:   required from ‘unique_ptr<
<template-parameter-1-1> >::~unique_ptr() [with <template-parameter-1-1> =
int]’
MachineFunctionAnalysis.ii:47:5:   required from ‘static _Require<G<typename
allocator_traits<_Alloc>::B::type> >
allocator_traits<_Alloc>::_S_destroy(allocator<unique_ptr<int> >&, _Tp*) [with
_Tp = unique_ptr<int>; _Alloc = allocator<unique_ptr<int> >;
_Require<G<typename allocator_traits<_Alloc>::B::type> > = int]’
MachineFunctionAnalysis.ii:52:23:   required from ‘static void
allocator_traits<_Alloc>::destroy(allocator<unique_ptr<int> >&, _Tp*) [with _Tp
= unique_ptr<int>; _Alloc = allocator<unique_ptr<int> >]’
MachineFunctionAnalysis.ii:63:61:   required from ‘void
_Destroy(_ForwardIterator, _ForwardIterator, _Allocator&) [with
_ForwardIterator = unique_ptr<int>*; _Allocator = allocator<unique_ptr<int> >]’
MachineFunctionAnalysis.ii:85:37:   required from ‘vector<
<template-parameter-1-1> >::~vector() [with <template-parameter-1-1> =
unique_ptr<int>]’
MachineFunctionAnalysis.ii:110:7:   required from here
MachineFunctionAnalysis.ii:90:34: error: invalid application of ‘sizeof’ to
incomplete type ‘A’
   void operator()(_Tp *) { sizeof(_Tp); }

Reply via email to