[LLVMbugs] [Bug 13366] New: Derived instantiation missing type, works in libstdc++, older versions of libc++

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jul 15 03:28:08 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13366

             Bug #: 13366
           Summary: Derived instantiation missing type, works in
                    libstdc++, older versions of libc++
           Product: libc++
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: samuel at oriontransfer.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8900
  --> http://llvm.org/bugs/attachment.cgi?id=8900
Example code that won't compile under libc++, but works fine in libstdc++ and
older versions of libc++.

See the attached file for a full listing of compiler commands and errors.

Essentially, it seems that there may be an issue with std::vector<TYPE> where
TYPE  inherits from a super-type defined in a derived class. I'm going to make
the assumption that the problem is perhaps due to TYPE not being completely
defined at the point of instantiation of std::vector<TYPE>, but I'm not
completely sure.

The full error is given below:

bug.cpp:25:39: error: no type named 'Override' in 'Application::Derived'
                struct Component : public DerivedT::Override {
                                          ~~~~~~~~~~^~~~~~~~
/usr/bin/../lib/c++/v1/type_traits:1889:54: note: in instantiation of member
class 'Framework::TestStaticComposition<Application::Derived>::Component'
requested here
decltype(_VSTD::move(_Tp(_VSTD::declval<_Args>()...)), true_type())
                                                     ^
/usr/bin/../lib/c++/v1/type_traits:1890:1: note: while substituting deduced
template arguments into function template '__is_constructible_test' [with _Tp =
     
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>,
_Args = <no value>]
__is_constructible_test(_Tp&&, _Args&& ...);
^
/usr/bin/../lib/c++/v1/type_traits:1949:14: note: in instantiation of template
class 'std::__1::__is_constructible<false,
     
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>,
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>
&&>' requested here
    : public __is_constructible<is_scalar<_Tp>::value ||
is_reference<_Tp>::value,
             ^
/usr/bin/../lib/c++/v1/type_traits:1975:14: note: in instantiation of template
class 'std::__1::__is_constructible_void_check<false,
     
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>,
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>
&&>' requested here
    : public __is_constructible_void_check<__contains_void<_Tp,
_Args...>::value
             ^
/usr/bin/../lib/c++/v1/type_traits:2455:34: note: in instantiation of template
class
'std::__1::is_constructible<std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>,
     
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>
&&>' requested here
    : __is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp,
_Args...>
                                 ^
/usr/bin/../lib/c++/v1/type_traits:2590:14: note: (skipping 2 contexts in
backtrace; use -ftemplate-backtrace-limit=0 to see all)
    : public is_nothrow_constructible<_Tp, typename
add_rvalue_reference<_Tp>::type>
             ^
/usr/bin/../lib/c++/v1/memory:2386:15: note: in instantiation of template class
'std::__1::__libcpp_compressed_pair_imp<Framework::TestStaticComposition<Application::Derived>::Component
*,
     
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>,
2>' requested here
    : private __libcpp_compressed_pair_imp<_T1, _T2>
              ^
/usr/bin/../lib/c++/v1/vector:339:48: note: in instantiation of template class
'std::__1::__compressed_pair<Framework::TestStaticComposition<Application::Derived>::Component
*,
     
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>>'
requested here
    __compressed_pair<pointer, allocator_type> __end_cap_;
                                               ^
/usr/bin/../lib/c++/v1/vector:484:15: note: in instantiation of template class
'std::__1::__vector_base<Framework::TestStaticComposition<Application::Derived>::Component,
     
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>>'
requested here
    : private __vector_base<_Tp, _Allocator>
              ^
bug.cpp:32:26: note: in instantiation of template class
'std::__1::vector<Framework::TestStaticComposition<Application::Derived>::Component,
     
std::__1::allocator<Framework::TestStaticComposition<Application::Derived>::Component>>'
requested here
                std::vector<Component> _components;
                                       ^
bug.cpp:40:25: note: in instantiation of template class
'Framework::TestStaticComposition<Application::Derived>' requested here
        class Derived : public TestStaticComposition<Derived> {
                               ^
1 error generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list