1// RUN: %check_clang_tidy %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 -fms-extensions
7
8struct S {};
9
10void f(__unaligned S *);
11
12void scope() {
13 // FIXME: This is a bug in the analysis, that is confused by '__unaligned'.
14 // https://bugs.llvm.org/show_bug.cgi?id=51756
15 S s;
16 // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 's' of type 'S' can be declared 'const'
17 // CHECK-FIXES: S const s;
18 f(&s);
19}
20

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