diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-07-16 14:16:56 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-07-16 14:16:56 +0000 |
commit | 2252cbf4e89d76b1c39da89b01d67b3e2b73154b (patch) | |
tree | 972a4a9393e381d401b0fd4acd64c20e6e1c0cb5 /clang-tools-extra/test/clang-tidy/google-namespaces.cpp | |
parent | 73ef216c73164e1012c22a8813e7543637163996 (diff) | |
download | bcm5719-llvm-2252cbf4e89d76b1c39da89b01d67b3e2b73154b.tar.gz bcm5719-llvm-2252cbf4e89d76b1c39da89b01d67b3e2b73154b.zip |
[clang-tidy] Add namespaces checkers.
This change contains of two checkers that warn about
1. anonymous namespaces in header files.
2. 'using namespace' directives everywhere.
Differential Revision: http://reviews.llvm.org/D4523
llvm-svn: 213153
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/google-namespaces.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/google-namespaces.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/google-namespaces.cpp b/clang-tools-extra/test/clang-tidy/google-namespaces.cpp new file mode 100644 index 00000000000..12c0b2ddcde --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/google-namespaces.cpp @@ -0,0 +1,8 @@ +// RUN: clang-tidy %s -checks='-*,google-build-namespaces,google-build-using-namespace' -header-filter='.*' -- | FileCheck %s -implicit-check-not="{{warning|error}}:" +#include "Inputs/google-namespaces.h" +// CHECK: warning: do not use unnamed namespaces in header files. + +using namespace spaaaace; +// CHECK: :[[@LINE-1]]:1: warning: do not use namespace using-directives. Use using-declarations instead. + +using spaaaace::core; // no-warning |