1 // RUN: %check_clang_tidy %s misc-const-correctness %t -- \
2 // RUN:   -config="{CheckOptions: [\
3 // RUN:   {key: 'misc-const-correctness.TransformValues', value: true}, \
4 // RUN:   {key: 'misc-const-correctness.TransformReferences', value: true}, \
5 // RUN:   {key: 'misc-const-correctness.WarnPointersAsValues', value: false}, \
6 // RUN:   {key: 'misc-const-correctness.TransformPointersAsValues', value: false}, \
7 // RUN:   ]}" -- -fno-delayed-template-parsing
8 
9 template <typename T>
type_dependent_variables()10 void type_dependent_variables() {
11   T value = 42;
12   auto &ref = value;
13   T &templateRef = value;
14 
15   int value_int = 42;
16   // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'value_int' of type 'int' can be declared 'const'
17   // CHECK-FIXES: int const value_int
18 }
instantiate_template_cases()19 void instantiate_template_cases() {
20   type_dependent_variables<int>();
21   type_dependent_variables<float>();
22 }
23