[llvm-bugs] [Bug 26103] New: Error calling is_convertible with incomplete type (using gcc or _LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 10 09:05:42 PST 2016


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

            Bug ID: 26103
           Summary: Error calling is_convertible with incomplete type
                    (using gcc or _LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
           Product: libc++
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mdaniels at qnx.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

Created attachment 15598
  --> https://llvm.org/bugs/attachment.cgi?id=15598&action=edit
Minimal example to reproduce

This was found trying to build llvm with gcc 5.3 + libc++ 3.7.0.

Using gcc+libstdc++ or clang+libc++ is fine, but I was able to reproduce with
clang+libc++ by adding -D_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK to the command.

I have reduced the problem as much as possible, see attached. I can reproduce
with the official 3.7.1 release for Ubuntu 14.04, but not the 3.6.2 releases. I
have narrowed this down to r233552, reverting that and this specific case
starts working again.

$ ./clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-14.04/bin/clang++ -std=gnu++11
-stdlib=libc++ -D_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK -o /tmp/test -c
/tmp/test.cpp
/tmp/test.cpp:4:18: error: incomplete type 'MyClass' named in nested name
specifier
  const typename Info::offset_type off;
                 ^~~~~~
/home/mdaniels/clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-14.04/bin/../include/c++/v1/type_traits:876:14:
note: in instantiation of template class 'InfoWrapper<MyClass>' requested here
    decltype(__test_convert<_To>(_VSTD::declval<_From>()))> : public true_type
             ^
/home/mdaniels/clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-14.04/bin/../include/c++/v1/type_traits:913:31:
note: during template argument deduction for class template partial
specialization
      '__is_convertible_test<type-parameter-0-0, type-parameter-0-1,
decltype(__test_convert<_To>(std::__1::declval<_From>()))>' [with _From =
InfoWrapper<MyClass> *, _To = InfoWrapper<MyClass> *]
        __is_convertible_imp::__is_convertible_test<_T1, _T2>::value
                              ^
/home/mdaniels/clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-14.04/bin/../include/c++/v1/type_traits:976:14:
note: in instantiation of template class
'std::__1::__is_convertible<InfoWrapper<MyClass> *, InfoWrapper<MyClass> *, 0,
0>'
      requested here
    : public __is_convertible<_T1, _T2>
             ^
/tmp/test.cpp:12:36: note: in instantiation of template class
'std::__1::is_convertible<InfoWrapper<MyClass> *, InfoWrapper<MyClass> *>'
requested here
  static const bool is_conv = std::is_convertible<MyInfo*, MyInfo*>::value;
                                   ^
/tmp/test.cpp:7:7: note: forward declaration of 'MyClass'
class MyClass;
      ^
1 error generated.

-- 
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/20160110/7fea255f/attachment.html>


More information about the llvm-bugs mailing list