[cfe-users] Bug report: Clang 5.0 (SVN r298093) cannot deduct class template arguments of tuple.
Csaba Raduly via cfe-users
cfe-users at lists.llvm.org
Thu Mar 30 00:44:58 PDT 2017
Hi,
Deducing template parameters for constructors is a C++17 feature. You
need to pass the -std=c++1z flag to the compiler.
On Thu, Mar 30, 2017 at 3:48 AM, 312988336 at qq.com via cfe-users
<cfe-users at lists.llvm.org> wrote:
> Hi, all,
>
> Below cannot be compiled with clang 5.0 (SVN r298093) on Visual Studio 2017.
>
> #include <tuple>
>
> using namespace std;
>
> int main()
> {
> tuple t{ 1, 3.14 };
> }
>
> The error message are as follows:
>
> 1>------ Build started: Project: cpptest, Configuration: Debug x64 ------
> 1>main.cpp(19,8): error : no viable constructor or deduction guide for
> deduction of template arguments of 'tuple'
> 1> tuple t{ 1, 3.14 };
> 1> ^
> 1>C:\Program Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\utility(88,8):
> note: candidate function template not viable: requires 0 arguments, but 2
> were provided
> 1> class tuple;
> 1> ^
> 1>C:\Program Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\utility(88,8):
> note: candidate function template not viable: requires 1 argument, but 2
> were provided
> 1>1 error generated.
> 1>Done building project "cpptest.vcxproj" -- FAILED.
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>
> I have applied for an account for submitting bugs of clang, but no response
> from the administrators. So I have to send mail to this forum.
>
> ________________________________
> 312988336 at qq.com
>
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>
--
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
More information about the cfe-users
mailing list