brintos

brintos / llvm-project-archived public Read only

0
0
Text · 789 B · 01b2e65 Raw
34 lines · cpp
1// RUN: %check_clang_tidy %s readability-static-accessed-through-instance %t -- -config="{CheckOptions: {readability-static-accessed-through-instance.NameSpecifierNestingThreshold: 4}}" --2 3// Nested specifiers4namespace M {5namespace N {6struct V {7  static int v;8  struct T {9    static int t;10    struct U {11      static int u;12    };13  };14};15}16}17 18void f(M::N::V::T::U u) {19  M::N::V v;20  v.v = 12;21  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: static member22  // CHECK-FIXES: M::N::V::v = 12;23 24  M::N::V::T w;25  w.t = 12;26  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: static member27  // CHECK-FIXES: M::N::V::T::t = 12;28 29  // u.u is not changed, because the nesting level is over 430  u.u = 12;31  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: static member32  // CHECK-FIXES: u.u = 12;33}34