20 lines · cpp
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-extensions7 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=5175615 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