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

ambiguous __construct_node while using tuple as a key for a map #16916

Closed
llvmbot opened this issue Jul 4, 2013 · 1 comment
Closed

ambiguous __construct_node while using tuple as a key for a map #16916

llvmbot opened this issue Jul 4, 2013 · 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 Jul 4, 2013

Bugzilla Link 16542
Resolution FIXED
Resolved on Jul 04, 2013 15:59
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

The following code compiles and behaves as expected using g++ as well as clang++ with libstdc++. But clang++ with libc++ produces errors. Here is the test code:

#include
#include
using namespace std;
int main()
{
map<tuple<int,int>, size_t> m;
m[make_tuple<int,int>(2,3)]=7;
}

The error remained the same under clang versions 3.3 (Revision: 185618) and 3.4 (Revision: 185530). Below, I quote the full error message.

In file included from maptest.cc:1:
/home/sandipan/local/llvm/3.3/include/c++/v1/map:1295:29: error: call to member function '__construct_node' is ambiguous
__node_holder __h = __construct_node(_VSTD::move(__k));
^~~~~~~~~~~~~~~~
maptest.cc:7:6: note: in instantiation of member function 'std::__1::map<std::__1::tuple<int, int>, unsigned long, std::__1::less<std::__1::tuple<int, int> >, std::__1::allocator<std::__1::pair<const std::__1::tuple<int, int>,
unsigned long> > >::operator[]' requested here
m[make_tuple<int,int>(2,3)]=7;
^
/home/sandipan/local/llvm/3.3/include/c++/v1/map:994:10: note: candidate function [with _A0 = std::__1::tuple<int, int>]
__construct_node(_A0&& __a0);
^
/home/sandipan/local/llvm/3.3/include/c++/v1/map:1001:10: note: candidate function [with _A0 = std::__1::tuple<int, int>]
__construct_node(_A0&& __a0);
^
/home/sandipan/local/llvm/3.3/include/c++/v1/map:1004:23: note: candidate function template not viable: requires at least 2 arguments, but 1 was provided
__node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
^
/home/sandipan/local/llvm/3.3/include/c++/v1/map:987:19: note: candidate function not viable: requires 0 arguments, but 1 was provided
__node_holder __construct_node();
^
1 error generated.

I haven't examined the code very carefully, but it seems there are two declarations as well as definitions of a function with the (effective) signature:

__node_holder __construct_node(_A0 &&);

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 4, 2013

Fix Committed revision 185666.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 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

1 participant