LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 44955 - clang++ 10.0 fails with libstdc++ from gcc 10-20200216
Summary: clang++ 10.0 fails with libstdc++ from gcc 10-20200216
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: 10.0
Hardware: PC Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks: release-10.0.0
  Show dependency tree
 
Reported: 2020-02-18 12:41 PST by Bernhard Rosenkraenzer
Modified: 2020-02-20 06:57 PST (History)
6 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkraenzer 2020-02-18 12:41:44 PST
Not 100% sure whether this is a libstdc++ bug or a clang bug. (Also filed a bug report against libstdc++ at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93818).

Using libstdc++ from gcc 10-20200216 breaks using it with clang 10 in C++20 mode.

/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1329:17: error: missing 'typename' prior to dependent type name 'iterator_traits<iterator_t<_Vp> >::iterator_category'
          using _Cat = iterator_traits<iterator_t<_Vp>>::iterator_category;
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1512:47: error: ambiguous deduction for template arguments of '_RangeAdaptor'
    inline constexpr __adaptor::_RangeAdaptor filter
                                              ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1073:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1513:9)]
        _RangeAdaptor(const _Callable& = {})
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1078:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1513:9)]
        _RangeAdaptor(_Callable __callable)
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1552:19: error: missing 'typename' prior to dependent type name 'iterator_traits<iterator_t<_Base> >::iterator_category'
            using _Cat = iterator_traits<iterator_t<_Base>>::iterator_category;
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1853:47: error: ambiguous deduction for template arguments of '_RangeAdaptor'
    inline constexpr __adaptor::_RangeAdaptor transform
                                              ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1073:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1854:9)]
        _RangeAdaptor(const _Callable& = {})
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1078:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1854:9)]
        _RangeAdaptor(_Callable __callable)
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2000:47: error: ambiguous deduction for template arguments of '_RangeAdaptor'
    inline constexpr __adaptor::_RangeAdaptor take
                                              ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1073:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2001:9)]
        _RangeAdaptor(const _Callable& = {})
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1078:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2001:9)]
        _RangeAdaptor(_Callable __callable)
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2092:47: error: ambiguous deduction for template arguments of '_RangeAdaptor'
    inline constexpr __adaptor::_RangeAdaptor take_while
                                              ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1073:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2093:9)]
        _RangeAdaptor(const _Callable& = {})
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1078:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2093:9)]
        _RangeAdaptor(_Callable __callable)
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2169:47: error: ambiguous deduction for template arguments of '_RangeAdaptor'
    inline constexpr __adaptor::_RangeAdaptor drop
                                              ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1073:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2170:9)]
        _RangeAdaptor(const _Callable& = {})
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1078:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2170:9)]
        _RangeAdaptor(_Callable __callable)
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2225:47: error: ambiguous deduction for template arguments of '_RangeAdaptor'
    inline constexpr __adaptor::_RangeAdaptor drop_while
                                              ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1073:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2226:9)]
        _RangeAdaptor(const _Callable& = {})
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1078:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2226:9)]
        _RangeAdaptor(_Callable __callable)
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2297:10: error: missing 'typename' prior to dependent type name 'iterator_traits<iterator_t<_Base> >::iterator_category'
              = iterator_traits<iterator_t<_Base>>::iterator_category;
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2299:10: error: missing 'typename' prior to dependent type name 'iterator_traits<iterator_t<range_reference_t<_Base> > >::iterator_category'
              = iterator_traits<iterator_t<range_reference_t<_Base>>>
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2768:19: error: missing 'typename' prior to dependent type name 'iterator_traits<iterator_t<_Base> >::iterator_category'
            using _Cat = iterator_traits<iterator_t<_Base>>::iterator_category;
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2942:47: error: ambiguous deduction for template arguments of '_RangeAdaptor'
    inline constexpr __adaptor::_RangeAdaptor split
                                              ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1073:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2943:9)]
        _RangeAdaptor(const _Callable& = {})
        ^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:1078:2: note: candidate function [with _Callable = std::ranges::views::(lambda at /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.0.0/../../../../include/c++/10.0.0/ranges:2943:9)]
        _RangeAdaptor(_Callable __callable)
        ^
12 errors generated.


libstdc++ from gcc 10-20200209 works perfectly with both gcc and clang.
Comment 1 Hans Wennborg 2020-02-19 04:51:49 PST
+Richard maybe?
Comment 2 Richard Smith 2020-02-19 08:41:03 PST
libstdc++ was relying on a C++20 feature we don't implement yet, and there's some disagreement between clang and gcc on a CTAD deduction too (but I don't think we know who is right yet). Both now fixed / worked around in libstdc++.
Comment 3 Hans Wennborg 2020-02-20 06:57:25 PST
(In reply to Richard Smith from comment #2)
> libstdc++ was relying on a C++20 feature we don't implement yet, and there's
> some disagreement between clang and gcc on a CTAD deduction too (but I don't
> think we know who is right yet). Both now fixed / worked around in libstdc++.

Okay, sounds like this can be closed then. Thanks!