[PATCH] D130689: [LLVM] Update C++ standard to 17

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 06:04:28 PDT 2022


aaron.ballman added a comment.

In D130689#3706303 <https://reviews.llvm.org/D130689#3706303>, @thieta wrote:

> In D130689#3706263 <https://reviews.llvm.org/D130689#3706263>, @aaron.ballman wrote:
>
>> 
>
>
>
>> Something odd is going on here and we might want to consider a revert of this patch until we resolve it. When I do a git pull and cmake files change, Visual Studio's built-in CMake support automatically re-runs the configure step. This should be all that's necessary to switch the toolchain, but it isn't for some reason (today's build is also failing for me with C++17 related issues after I did another pulldown this morning). I deleted my cache explicitly and regenerated CMake from scratch and am still getting the same build errors. The failures I am getting are the same as what's shown by the sanitizer bot for Windows: https://lab.llvm.org/buildbot/#/builders/127/builds/33980/steps/4/logs/stdio (I'm using VS 2019 16.11.17 FWIW).
>>
>> I hope we can resolve this quickly as basically no MSVC builds are green right now in the build lab.
>
> While we can revert this one - we also need to revert all changes that add C++17 features at this point as well. That will be a lot of churn. Let's see if we can figure out what's wrong first.

That's the only reason this hasn't been reverted already. Landing sweeping changes on a weekend is a good way to reduce the pain, but we really need to be sure someone watches the build lab and reacts when subsequent changes break everything like this.

> Can you try to locally rebuild with this patch https://reviews.llvm.org/D131382 ?

That improves things but the build still isn't clean:

  Severity	Code	Description	Project	File	Line	Suppression State
  Warning	C4996	'std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the <codecvt> header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\third-party\benchmark\src\sysinfo.cc	429	
  Warning	C4996	'std::wstring_convert<convert_type,wchar_t,std::allocator<wchar_t>,std::allocator<char>>': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the <codecvt> header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\third-party\benchmark\src\sysinfo.cc	430	
  Warning	C4996	'std::wstring_convert<convert_type,wchar_t,std::allocator<wchar_t>,std::allocator<char>>::wstring_convert': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the <codecvt> header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\third-party\benchmark\src\sysinfo.cc	430	
  Warning	C4996	'std::wstring_convert<convert_type,wchar_t,std::allocator<wchar_t>,std::allocator<char>>::to_bytes': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the <codecvt> header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\third-party\benchmark\src\sysinfo.cc	432	
  Warning	C4996	'std::iterator<std::input_iterator_tag,const clang::pseudo::ForestNode,ptrdiff_t,const clang::pseudo::ForestNode *,const clang::pseudo::ForestNode &>': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\clang-tools-extra\pseudo\include\clang-pseudo\Forest.h	202	
  Warning	C4996	'std::iterator<std::input_iterator_tag,const clang::pseudo::ForestNode,ptrdiff_t,const clang::pseudo::ForestNode *,const clang::pseudo::ForestNode &>': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\clang-tools-extra\pseudo\include\clang-pseudo\Forest.h	202	
  Warning	C4996	'std::iterator<std::input_iterator_tag,const clang::pseudo::ForestNode,ptrdiff_t,const clang::pseudo::ForestNode *,const clang::pseudo::ForestNode &>': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\clang-tools-extra\pseudo\include\clang-pseudo\Forest.h	202	
  Warning	C4996	'std::iterator<std::input_iterator_tag,const clang::pseudo::ForestNode,ptrdiff_t,const clang::pseudo::ForestNode *,const clang::pseudo::ForestNode &>': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\clang-tools-extra\pseudo\include\clang-pseudo\Forest.h	202	
  Warning	C4996	'std::iterator<std::input_iterator_tag,const clang::pseudo::ForestNode,ptrdiff_t,const clang::pseudo::ForestNode *,const clang::pseudo::ForestNode &>': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\clang-tools-extra\pseudo\include\clang-pseudo\Forest.h	202	
  Warning	C4996	'std::iterator<std::input_iterator_tag,const clang::pseudo::ForestNode,ptrdiff_t,const clang::pseudo::ForestNode *,const clang::pseudo::ForestNode &>': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.	F:\source\llvm-project\llvm\out\build\x64-Debug\llvm	F:\source\llvm-project\clang-tools-extra\pseudo\include\clang-pseudo\Forest.h	202	

(FWIW, I don't know if any of the Windows builders in the lab are building with /WX)

> I think all the runtime errors is because of that one above - basically we don't set std=c++17 for any of the compiler-rt projects.

I wasn't building compiler-rt, so no idea why this improved things for me. FWIW, he's my CMake config: `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_IDE=ON -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_PARALLEL_COMPILE_JOBS=112 -DLLVM_PARALLEL_LINK_JOBS=16`

> I also think we should merge https://reviews.llvm.org/D131367 for now - we can revert that later on if we think it adds to much complexity, since it will delete the bad cache values automatcially.

Seems reasonable to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130689/new/

https://reviews.llvm.org/D130689



More information about the cfe-commits mailing list