summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
diff options
context:
space:
mode:
authorSamuel Benzaquen <sbenza@google.com>2015-03-24 15:21:45 +0000
committerSamuel Benzaquen <sbenza@google.com>2015-03-24 15:21:45 +0000
commit3199b9a8b54e95fd76d04aec503ebe2f7c18a572 (patch)
treee8c405b8d4095346dcc2e469544a73c7b08192fa /clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
parentc676f2a8bbab473efe91344c2f25fd181461113c (diff)
downloadbcm5719-llvm-3199b9a8b54e95fd76d04aec503ebe2f7c18a572.tar.gz
bcm5719-llvm-3199b9a8b54e95fd76d04aec503ebe2f7c18a572.zip
Fix false positive on anonymous namespaces in headers.
Summary: Anynoumous namespaces inject a using directive into the AST to import the names into the containing namespace. We should not have them in headers, but there is another warning for that. Reviewers: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8443 llvm-svn: 233087
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
index 806eecd7985..feb7ae913f9 100644
--- a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
@@ -101,6 +101,10 @@ TEST_F(GlobalNamesInHeadersCheckTest, UsingDirectives) {
EXPECT_FALSE(runCheckOnCode("SOME_MACRO(namespace std);", "foo.h"));
}
+TEST_F(GlobalNamesInHeadersCheckTest, RegressionAnonymousNamespace) {
+ EXPECT_FALSE(runCheckOnCode("namespace {}", "foo.h"));
+}
+
} // namespace test
} // namespace tidy
} // namespace clang
OpenPOWER on IntegriCloud