[all-commits] [llvm/llvm-project] fda777: [clang-tidy] Update tests to include C++23 and C++26

Adrian Vogelsgesang via All-commits all-commits at lists.llvm.org
Mon Aug 7 14:25:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fda777849b0088ba83e28683c53c5c8321ef2558
      https://github.com/llvm/llvm-project/commit/fda777849b0088ba83e28683c53c5c8321ef2558
  Author: Adrian Vogelsgesang <avogelsgesang at salesforce.com>
  Date:   2023-08-07 (Mon, 07 Aug 2023)

  Changed paths:
    M clang-tools-extra/test/clang-tidy/check_clang_tidy.py
    A clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-values-before-cxx23.cpp
    M clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-values.cpp
    M clang-tools-extra/test/clang-tidy/checkers/misc/unconventional-assign-operator.cpp
    M clang-tools-extra/test/clang-tidy/checkers/readability/container-contains.cpp

  Log Message:
  -----------
  [clang-tidy] Update tests to include C++23 and C++26

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.

Differential Revision: https://reviews.llvm.org/D157246




More information about the All-commits mailing list