Skip to content
Commit 490811ec authored by Ben Hamilton's avatar Ben Hamilton
Browse files

[clang-tidy] Function-scoped static variables should not trigger...

[clang-tidy] Function-scoped static variables should not trigger google-objc-global-variable-declaration

Summary:
google-objc-global-variable-declaration currently triggers on
valid code like:

  - (void)foo {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{ /* ... */ });
  }

The Google Objective-C style guide says:

http://google.github.io/styleguide/objcguide.html#common-variable-names

> File scope or global variables (as opposed to constants) declared
> outside the scope of a method or function should be rare, and should
> have the prefix g.

which is meant to insinuate that static variables inside a method or
function don't need a special name.

Test Plan: `make -j12 check-clang-tools`

Reviewers: Wizard, hokein, klimek

Reviewed By: Wizard

Subscribers: xazax.hun, cfe-commits

Differential Revision: https://reviews.llvm.org/D41789

llvm-svn: 321914
parent 063e6cc5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment