-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
| Bugzilla Link | 9975 |
| Resolution | INVALID |
| Resolved on | May 21, 2011 16:54 |
| Version | trunk |
| OS | MacOS X |
| Attachments | Does not compile, Does compile |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor,@zygoloid |
Extended Description
I have two programs involving clang tip-of-trunk in c++0x mode which I can not reconcile. The version is:
Apple clang version 3.0 (trunk 131724) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.7.0
Thread model: posix
The attached preprocessed test1.cpp does not compile and the first error message is:
$ clang++ -std=c++0x test1.cpp
In file included from test.cpp:1:
In file included from test.cpp:16:
/usr/include/c++/v1/functional:1620:8: error: no type named 'type' in 'std::__1::__invoke_of<void (&)(const std::__1::basic_string<char,
std::__1::char_traits, std::__1::allocator > &), char const (&)[1]>'
>::type type;
~~~^~~~
/usr/include/c++/v1/functional:1670:18: note: in instantiation of template class 'std::__1::__bind_return<void ()(const std::__1::basic_string<char,
std::__1::char_traits, std::__1::allocator > &), std::__1::tuple<std::__1::placeholders::__ph<1> >, std::__1::tuple<char const (&)[1]> >'
requested here
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
^
/usr/include/c++/v1/functional:1671:9: note: while substituting deduced template arguments into function template 'operator()'
[with _Args = <char const (&)[1]>]
operator()(_Args&& ...__args)
^
test.cpp:31:3: note: in instantiation of function template specialization 'doIt<std::__1::__bind<void (*)(const std::__1::basic_string<char,
std::__1::char_traits, std::__1::allocator > &), std::__1::placeholders::__ph<1> &> >' requested here
doIt(std::bind(&method, _1));
^
In investigating the cause of this error message I developed test2.cpp which compiles, runs and outputs:
$ clang++ -std=c++0x -stdlib=libc++ test2.cpp
1
v
This second test is directly inspecting the trait std::__invoke_of mentioned in test1's error message:
std::cout << typeid(std::__invoke_of<void (*&)(const std::string &), char const (&)[1]>::type).name() << '\n';
Its output contradicts the error message from test1, indicating that this invocation of std::__invoke does have a nested type named 'type', and it has type void.