brintos

brintos / llvm-project-archived public Read only

0
0
Text · 903 B · c8a5752 Raw
25 lines · cpp
1// RUN: %check_clang_tidy %s abseil-no-namespace %t -- -header-filter='' -- -I %S/Inputs2// RUN: clang-tidy -checks='-*, abseil-no-namespace' -header-filter='.*' %s -- -I %S/Inputs 2>&1 | FileCheck %s3 4/// Warning will not be triggered on internal Abseil code that is included.5#include "absl/strings/internal-file.h"6// CHECK-NOT: warning:7 8/// Warning will be triggered on code that is not internal that is included.9#include "absl/external-file.h"10// CHECK: absl/external-file.h:1:11: warning: namespace 'absl' is reserved11 12namespace absl {}13// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: namespace 'absl' is reserved for implementation of the Abseil library and should not be opened in user code [abseil-no-namespace]14 15namespace absl {16// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: namespace 'absl'17namespace std {18int i = 5;19}20}21 22// Things that shouldn't trigger the check23int i = 5;24namespace std {}25