Community
Participate
Working Groups
Given a variadic template function: template <typename...> void f() {} Both of the following ways of calling it with no template parameters should be valid: int main() { f(); // way 1 f<>(); // way 2 } For both, CDT gives the error: "Invalid arguments ' Candidates are: void f()'"
I believe this is the same issue causing the following behavior with the latest release of libstdc++(gcc 4.6.1) : [dhunt@dhunt /tmp]$ cat > chk.cpp #include <string> #include <tuple> void f() { std::tuple<std::string, std::string, uint64_t, std::string> tup; std::get<0>(tup).c_str(); } [dhunt@dhunt /tmp]$ g++ -std=c++0x -c chk.cpp [dhunt@dhunt /tmp]$ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/home/dhunt/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ./configure --prefix=/home/dhunt/ --enable-languages=c,c++ --with-mpfr=/home/dhunt --with-gmp=/home/dhunt --with-mpc=/home/dhunt Thread model: posix gcc version 4.6.1 (GCC) The indexer gives a semantic error on the call to "std::get" with "Method c_str() could not be resolved".
Works with the latest version on the master branch. The problem has the same root cause as bug 355304, the template argument deduction without function parameters did not work. Added testcase.
*** cdt git genie on behalf of Markus Schorn *** Bug 358654: Added testcase. [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=c88a6117fda52879617c1d7cb5a021bb33346378
*** cdt git genie on behalf of Markus Schorn *** Bug 358654: Improve name of testcase. [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=0975b80370b4cce6cb12f0de3ede06fa6f442cc3