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

tuple's "TupleLike" constructors behave slightly differently than standard versions #27749

Closed
llvmbot opened this issue Apr 15, 2016 · 1 comment
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 15, 2016

Bugzilla Link 27375
Resolution FIXED
Resolved on Jun 08, 2021 08:42
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @ldionne,@mclow

Extended Description

Libc++ implements the two standard constructors 1) 'tuple(tuple<Up...> const&)' and 2) 'tuple(tuple<Up...>&&)' as a single generic overload 'tuple(Tuple&&)'. This can cause a slight differences in overload resolution.

For example the call to 'tuple(tuple<...>{})' will first consider ctor #​2. However if this constructor SFINAE's aware then ctor #​1 should be considered.
Since libc++ only provides a single overload it will only consider #​2. This breaks the following code:

std::tuple<int&>(std::tuple<int&&>(42));

@ldionne
Copy link
Member

ldionne commented Jun 8, 2021

This is fixed since Clang 9. I don't have the specific commit, but I reproduced on godbolt:

Clang 8 (fails): https://godbolt.org/z/Eh67c6fPM
Clang 9 (works): https://godbolt.org/z/jo9s1bPxW

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

2 participants