Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation failure when using libstdc++10 #1929

Merged

Conversation

akemimadoka
Copy link
Contributor

Description

Sorry for my poor English, I'm not a native speaker.
The failure case is published on https://wandbox.org/permlink/E3IuG3dbqTTDAwxv
Which can be fixed by this patch as https://wandbox.org/permlink/jDqVGe2TlJ8F3Q9r
This bug is caused by std::__detail::begin declared by bits/iterator_concepts.h, the function may be lookup by adl, like the case above, so here will be a matched but deleted begin, not the begin returning not_this_one
This patch fixed the bug by detecting whether expression begin(std::declval()) is well-formed directly
The void_type is introduced because of issue mentioned here

GitHub Issues

The failure case is published on https://wandbox.org/permlink/E3IuG3dbqTTDAwxv
Which can be fixed by this patch as https://wandbox.org/permlink/jDqVGe2TlJ8F3Q9r
This bug is caused by std::__detail::begin declared by bits/iterator_concepts.h, the function may be lookup by adl, like the case above, so here will be a matched but deleted begin, not the begin returning not_this_one
This patch fixed the bug by detecting whether expression begin(std::declval<T>()) is well-formed directly
@codecov
Copy link

codecov bot commented May 14, 2020

Codecov Report

Merging #1929 into master will increase coverage by 1.82%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1929      +/-   ##
==========================================
+ Coverage   86.80%   88.61%   +1.82%     
==========================================
  Files         131      138       +7     
  Lines        3923     5603    +1680     
==========================================
+ Hits         3405     4965    +1560     
- Misses        518      638     +120     

@horenmar
Copy link
Member

Thanks.

@horenmar horenmar merged commit c190061 into catchorg:master May 15, 2020
nitnelave pushed a commit to nitnelave/Catch2 that referenced this pull request May 25, 2020
The issue is caused by deleted `std::__detail::begin` declared in `bits/iterator_concepts.h`. This would be found by ADL, and because it is deleted, compilation would fail. This change makes it so that we SFINAE on `begin(std::declval<T>())` and `end(std::declval<T>())` being well-formed.
cenit pushed a commit to physycom/Catch that referenced this pull request Aug 8, 2020
The issue is caused by deleted `std::__detail::begin` declared in `bits/iterator_concepts.h`. This would be found by ADL, and because it is deleted, compilation would fail. This change makes it so that we SFINAE on `begin(std::declval<T>())` and `end(std::declval<T>())` being well-formed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants