-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't workingcompilerCompiler work involvedCompiler work involvedresolvedSuccessfully resolved without a commitSuccessfully resolved without a commit
Description
Describe the bug
When import <format> as a headerunit, using std::format_to leads to an error C2668 in Release mode.
This problem does not occur in Debug mode.
Command-line test case
D:\cpptest>type repro.cpp
import <format>;
import <string>;
int main()
{
std::string msg;
std::format_to(std::back_inserter(msg), "{}", "");
return 0;
}
D:\cpptest>cl /std:c++20 /permissive- /GS /GL /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl /Zc:inline /fp:precise /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /WX- /Zc:forScope /Gd /Oi /MD /std:c++20 /EHsc /nologo /exportHeader /headerName:angle format string
format
string
D:\cpptest>cl /std:c++20 /permissive- /GS /GL /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl /Zc:inline /fp:precise /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /WX- /Zc:forScope /Gd /Oi /MD /std:c++20 /EHsc /nologo /headerUnit:angle format=format.ifc /headerUnit:angle string=string.ifc repro.cpp /c
repro.cpp
D:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.29.30035\include\format(2461): error C2668: 'abs': ambiguous call to overloaded function
D:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.29.30035\include\cstdlib(27): note: could be 'float abs(float) noexcept'
D:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.29.30035\include\cstdlib(27): note: or 'float abs(float) noexcept'
D:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.29.30035\include\format(2461): note: while trying to match the argument list '(const _Float)'
......
Expected behavior
The file should compile successfully.
STL version
Microsoft Visual Studio Enterprise 2019 Preview
Version 16.10.0 Preview 3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompilerCompiler work involvedCompiler work involvedresolvedSuccessfully resolved without a commitSuccessfully resolved without a commit