This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix performance-noexcept-move-constructor-fix.cpp on non-English locale
ClosedPublic

Authored by aganea on Feb 12 2020, 11:43 AM.

Details

Summary

When running on Windows under the following locale:

D:\llvm-project>python
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getlocale()
('French_Canada', '1252')

This patch fixes the following issue:

# command stderr:
Traceback (most recent call last):
  File "D:/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py", line 249, in <module>
    main()
  File "D:/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py", line 245, in main
    run_test_once(args, extra_args)
  File "D:/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py", line 162, in run_test_once
    diff_output.decode() +
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 2050: invalid continuation byte

This is caused by diff reporting no EOL on the last line, and unfortunately this is written in French with accentuation on my locale.

Diff Detail

Event Timeline

aganea created this revision.Feb 12 2020, 11:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2020, 11:43 AM
aganea updated this revision to Diff 244246.Feb 12 2020, 12:01 PM

Better fix.

aganea edited the summary of this revision. (Show Details)Feb 13 2020, 9:51 AM
rnk accepted this revision.Feb 13 2020, 10:40 AM

lgtm, if the diff comes out wrong, that will not result in an incorrect pass/fail, but only less debugable output.

This revision is now accepted and ready to land.Feb 13 2020, 10:40 AM
This revision was automatically updated to reflect the committed changes.