[llvm-bugs] [Bug 37911] New: clang-cl emits bogus error LNK2019: unresolved external symbol _wmemchr

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 22 17:14:16 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37911

            Bug ID: 37911
           Summary: clang-cl emits bogus error LNK2019: unresolved
                    external symbol _wmemchr
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sfinae at hotmail.com
                CC: llvm-bugs at lists.llvm.org

This was reported to MSVC:
https://developercommunity.visualstudio.com/content/problem/234075/unresolved-symbols-in-iosfwd-with-has-constexpr-ch-1.html

It appears to be a Clang bug.

C:\Temp\CLANG_REPRO>clang-cl -m32 -v
clang version 6.0.0 (tags/RELEASE_600/final)
Target: i386-pc-windows-msvc
Thread model: posix
InstalledDir: S:\msvc\src\vctools\NonShip\ClangLLVM\bin

C:\Temp\CLANG_REPRO>type pch.h
#pragma once
#include <string>

C:\Temp\CLANG_REPRO>type pch.cpp
// empty file

C:\Temp\CLANG_REPRO>type test.cpp
int main() {
    (void) std::wstring().find(L' ', 0);
}

C:\Temp\CLANG_REPRO>clang-cl -m32 /EHsc /nologo /W4 -Ycpch.h -FI pch.h pch.cpp
-c -std:c++latest -MDd

C:\Temp\CLANG_REPRO>clang-cl -m32 /EHsc /nologo /W4 -Yupch.h -FI pch.h test.cpp
pch.obj -std:c++latest -MDd
test-c47dea.obj : error LNK2019: unresolved external symbol _wmemchr referenced
in function "public: static wchar_t const * __cdecl
std::_WChar_traits<wchar_t>::find(wchar_t const *,unsigned int,wchar_t const
&)" (?find@?$_WChar_traits at _W@std@@SAPB_WPB_WIAB_W at Z)
test.exe : fatal error LNK1120: 1 unresolved externals
clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see
invocation)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180623/8268a532/attachment.html>


More information about the llvm-bugs mailing list