brintos

brintos / llvm-project-archived public Read only

0
0
Text · 804 B · c39f718 Raw
22 lines · cpp
1// RUN: %check_clang_tidy %s llvm-qualified-auto %t2 3// This check just ensures by default the llvm alias doesn't add const4// qualifiers to decls, so no need to copy the entire test file from5// readability-qualified-auto.6 7int *getIntPtr();8const int *getCIntPtr();9 10void foo() {11  auto NakedPtr = getIntPtr();12  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: 'auto NakedPtr' can be declared as 'auto *NakedPtr'13  // CHECK-FIXES: auto *NakedPtr = getIntPtr();14  auto NakedConstPtr = getCIntPtr();15  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: 'auto NakedConstPtr' can be declared as 'const auto *NakedConstPtr'16  // CHECK-FIXES: const auto *NakedConstPtr = getCIntPtr();17  auto *Ptr = getIntPtr();18  auto *ConstPtr = getCIntPtr();19  auto &NakedRef = *getIntPtr();20  auto &NakedConstRef = *getCIntPtr();21}22