diff options
author | Samuel Benzaquen <sbenza@google.com> | 2015-03-24 15:21:45 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2015-03-24 15:21:45 +0000 |
commit | 3199b9a8b54e95fd76d04aec503ebe2f7c18a572 (patch) | |
tree | e8c405b8d4095346dcc2e469544a73c7b08192fa /clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp | |
parent | c676f2a8bbab473efe91344c2f25fd181461113c (diff) | |
download | bcm5719-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.cpp | 4 |
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 |