在Windows上使用Clang进行编译时,std :: map :: insert_or_assign的编译失败

时间:2017-06-25 15:02:32

标签: c++ gcc c++17 clang++ c++-standard-library

我试图编译来自"关联容器的改进界面"来自Rainer Grimm的博客,但它在std :: map :: insert_or_assign上窒息。当然在带有clang的Windows上你必须使用GCC头文件

问题是它在GCC标题中出现了一个奇怪的错误

clang++ -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 --target=i686-w64-mingw32 -stdlib=libstdc++ -v -std=c++1z -o preview.bc "..\\..\\..\\..\\..\\Libraries\\ModernesCppSource\\source\\preview.cpp" 
clang version 4.0.0 (tags/RELEASE_400/final)
Target: i686-w64-windows-gnu
Thread model: posix
InstalledDir: E:\Compilers\LLVM32\bin
 "E:\\Compilers\\LLVM32\\bin\\clang++.exe" -cc1 -triple i686-w64-windows-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free -main-file-name preview.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -v -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -coverage-notes-file "E:\\Documents\\Programming\\Code\\Local Projects\\CEvelop\\AnotherSolutionIMeanWorkspace\\Test2\\Debug\\preview.gcno" -resource-dir "E:\\Compilers\\LLVM32\\bin\\..\\lib\\clang\\4.0.0" -internal-isystem "E:\\Compilers\\mingw32\\i686-w64-mingw32\\include\\c++" -internal-isystem "E:\\Compilers\\mingw32\\i686-w64-mingw32\\include\\c++\\i686-w64-mingw32" -internal-isystem "E:\\Compilers\\mingw32\\i686-w64-mingw32\\include\\c++\\backward" -internal-isystem "E:\\Compilers\\mingw32\\i686-w64-mingw32\\include\\c++\\7.1.0" -internal-isystem "E:\\Compilers\\mingw32\\i686-w64-mingw32\\include\\c++\\7.1.0\\i686-w64-mingw32" -internal-isystem "E:\\Compilers\\mingw32\\i686-w64-mingw32\\include\\c++\\7.1.0\\backward" -internal-isystem "E:\\Compilers\\mingw32\\include\\c++\\7.1.0" -internal-isystem "E:\\Compilers\\mingw32\\include\\c++\\7.1.0\\i686-w64-mingw32" -internal-isystem "E:\\Compilers\\mingw32\\include\\c++\\7.1.0\\backward" -internal-isystem "E:\\Compilers\\mingw32\\lib\\gcc\\i686-w64-mingw32\\7.1.0\\include\\c++" -internal-isystem "E:\\Compilers\\mingw32\\lib\\gcc\\i686-w64-mingw32\\7.1.0\\include\\c++\\i686-w64-mingw32" -internal-isystem "E:\\Compilers\\mingw32\\lib\\gcc\\i686-w64-mingw32\\7.1.0\\include\\c++\\backward" -internal-isystem "E:\\Compilers\\LLVM32\\bin\\..\\lib\\clang\\4.0.0\\include" -internal-isystem "E:\\Compilers\\mingw32\\lib\\gcc\\i686-w64-mingw32\\7.1.0\\include" -internal-isystem "E:\\Compilers\\mingw32\\i686-w64-mingw32/sys-root/mingw/include" -internal-isystem "E:\\Compilers\\mingw32\\lib\\gcc\\i686-w64-mingw32\\7.1.0\\include-fixed" -internal-isystem "E:\\Compilers\\mingw32\\i686-w64-mingw32\\include" -internal-isystem "E:\\Compilers\\mingw32\\include" -O0 -Wall -std=c++1y -fdeprecated-macro -fdebug-compilation-dir "E:\\Documents\\Programming\\Code\\Local Projects\\CEvelop\\AnotherSolutionIMeanWorkspace\\Test2\\Debug" -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o preview.bc -x c++ "..\\..\\..\\..\\..\\Libraries\\ModernesCppSource\\source\\preview.cpp"
clang -cc1 version 4.0.0 based upon LLVM 4.0.0 default target i686-pc-windows-msvc
ignoring nonexistent directory "E:\Compilers\mingw32\i686-w64-mingw32\include\c++"
ignoring nonexistent directory "E:\Compilers\mingw32\i686-w64-mingw32\include\c++\i686-w64-mingw32"
ignoring nonexistent directory "E:\Compilers\mingw32\i686-w64-mingw32\include\c++\backward"
ignoring nonexistent directory "E:\Compilers\mingw32\i686-w64-mingw32\include\c++\7.1.0"
ignoring nonexistent directory "E:\Compilers\mingw32\i686-w64-mingw32\include\c++\7.1.0\i686-w64-mingw32"
ignoring nonexistent directory "E:\Compilers\mingw32\i686-w64-mingw32\include\c++\7.1.0\backward"
ignoring nonexistent directory "E:\Compilers\mingw32\include\c++\7.1.0"
ignoring nonexistent directory "E:\Compilers\mingw32\include\c++\7.1.0\i686-w64-mingw32"
ignoring nonexistent directory "E:\Compilers\mingw32\include\c++\7.1.0\backward"
ignoring nonexistent directory "E:\Compilers\mingw32\i686-w64-mingw32/sys-root/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 E:\Compilers\mingw32\lib\gcc\i686-w64-mingw32\7.1.0\include\c++
 E:\Compilers\mingw32\lib\gcc\i686-w64-mingw32\7.1.0\include\c++\i686-w64-mingw32
 E:\Compilers\mingw32\lib\gcc\i686-w64-mingw32\7.1.0\include\c++\backward
 E:\Compilers\LLVM32\bin\..\lib\clang\4.0.0\include
 E:\Compilers\mingw32\lib\gcc\i686-w64-mingw32\7.1.0\include
 E:\Compilers\mingw32\lib\gcc\i686-w64-mingw32\7.1.0\include-fixed
 E:\Compilers\mingw32\i686-w64-mingw32\include
 E:\Compilers\mingw32\include
End of search list.
E:\Compilers\mingw32\lib\gcc\i686-w64-mingw32\7.1.0\include\c++\optional:1032:27: error: use of class template 'optional' requires template arguments
  template <typename _Tp> optional(_Tp) -> optional<_Tp>;
                      ^
E:\Compilers\mingw32\lib\gcc\i686-w64-mingw32\7.1.0\include\c++\optional:451:11: note: template is declared here
class optional
      ^
E:\Compilers\mingw32\lib\gcc\i686-w64-mingw32\7.1.0\include\c++\optional:1032:40: error: expected ';' at end of declaration
  template <typename _Tp> optional(_Tp) -> optional<_Tp>;
                                   ^
E:\Compilers\mingw32\lib\gcc\i686-w64-mingw32\7.1.0\include\c++\optional:1032:41: error: cannot use arrow operator on a type
  template <typename _Tp> optional(_Tp) -> optional<_Tp>;
                                        ^

生成3个错误。

有谁知道如何解决这个问题?

0 个答案:

没有答案