1// RUN: %check_clang_tidy -std=c++11,c++14,c++17,c++20 %s misc-const-correctness %t -- \
2// RUN: -config="{CheckOptions: {\
3// RUN: misc-const-correctness.TransformValues: true, \
4// RUN: misc-const-correctness.WarnPointersAsValues: false, \
5// RUN: misc-const-correctness.TransformPointersAsValues: false \
6// RUN: }}" -- -fno-delayed-template-parsing
7
8
9double &non_const_ref_return() {
10 double p_local0 = 0.0;
11 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: variable 'p_local0' of type 'double' can be declared 'const'
12 // CHECK-FIXES: double const p_local0
13 double np_local0 = 42.42;
14 return np_local0;
15}
16
17double *&return_non_const_pointer_ref() {
18 double *np_local0 = nullptr;
19 return np_local0;
20}
21

source code of clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-values-before-cxx23.cpp