This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Update tests to include C++23 and C++26
ClosedPublic

Authored by avogelsgesang on Aug 6 2023, 5:31 PM.

Details

Summary

This commit changes the c++xx-or-later definitions to also include
C++23 and the upcoming C++26.
readability/container-contains.cpp to also test newer C++ versions.

Also, this commit adjusts a couple of test cases slightly:

  • container-contains.cpp now also tests newer C++ versions. Restricting it to C++20 was an oversight of mine when originally writing this check.
  • unconventional-assign-operator.cpp: The return rhs raised a "non-const lvalue reference to type 'BadReturnStatement' cannot bind to a temporary" error in C++23. The issue is circumenvented by writing return *&rhs.
  • const-correctness-values.cpp was also running into the same error in C++23. The troublesome test cases were moved to a separate file.

Diff Detail

Event Timeline

avogelsgesang created this revision.Aug 6 2023, 5:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2023, 5:31 PM
avogelsgesang requested review of this revision.Aug 6 2023, 5:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2023, 5:31 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Aug 6 2023, 11:02 PM
PiotrZSL added inline comments.Aug 7 2023, 9:33 AM
clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-values-before-cxx23.cpp
3–7

Address comments

PiotrZSL accepted this revision.Aug 7 2023, 1:37 PM
avogelsgesang marked an inline comment as done.Aug 7 2023, 1:45 PM
This revision was landed with ongoing or failed builds.Aug 7 2023, 2:25 PM
This revision was automatically updated to reflect the committed changes.