Author: Marcel Hlopko Date: 2020-03-13T10:55:24+01:00 New Revision: f8640737d4767cb88225e84515a6a2bd992cb84f
URL: https://github.com/llvm/llvm-project/commit/f8640737d4767cb88225e84515a6a2bd992cb84f DIFF: https://github.com/llvm/llvm-project/commit/f8640737d4767cb88225e84515a6a2bd992cb84f.diff LOG: Refactor SourceLocationTest to `using namespace` Summary: Only for the readability reasons. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D76120 Added: Modified: clang/unittests/AST/SourceLocationTest.cpp Removed: ################################################################################ diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp index f401f77af0f5..c3eefc88a0c7 100644 --- a/clang/unittests/AST/SourceLocationTest.cpp +++ b/clang/unittests/AST/SourceLocationTest.cpp @@ -23,8 +23,10 @@ #include "llvm/Testing/Support/Annotations.h" #include "gtest/gtest.h" -namespace clang { -namespace ast_matchers { +using namespace clang; +using namespace clang::ast_matchers; + +namespace { // FIXME: Pull the *Verifier tests into their own test file. @@ -643,10 +645,8 @@ TEST(FunctionDecl, FunctionDeclWithThrowSpecification) { TEST(FunctionDecl, FunctionDeclWithNoExceptSpecification) { RangeVerifier<FunctionDecl> Verifier; Verifier.expectRange(1, 1, 1, 24); - EXPECT_TRUE(Verifier.match( - "void f() noexcept(false);\n", - functionDecl(), - Language::Lang_CXX11)); + EXPECT_TRUE(Verifier.match("void f() noexcept(false);\n", functionDecl(), + Lang_CXX11)); } class FunctionDeclParametersRangeVerifier : public RangeVerifier<FunctionDecl> { @@ -768,12 +768,10 @@ TEST(CXXMethodDecl, CXXMethodDeclWithThrowSpecification) { TEST(CXXMethodDecl, CXXMethodDeclWithNoExceptSpecification) { RangeVerifier<FunctionDecl> Verifier; Verifier.expectRange(2, 1, 2, 24); - EXPECT_TRUE(Verifier.match( - "class A {\n" - "void f() noexcept(false);\n" - "};\n", - functionDecl(), - Language::Lang_CXX11)); + EXPECT_TRUE(Verifier.match("class A {\n" + "void f() noexcept(false);\n" + "};\n", + functionDecl(), Lang_CXX11)); } class ExceptionSpecRangeVerifier : public RangeVerifier<TypeLoc> { @@ -816,19 +814,19 @@ TEST(FunctionDecl, ExceptionSpecifications) { std::vector<std::string> Args; Args.push_back("-fms-extensions"); EXPECT_TRUE(Verifier.match("void f() throw(...);\n", loc(functionType()), - Args, Language::Lang_CXX)); + Args, Lang_CXX)); Verifier.expectRange(1, 10, 1, 10); - EXPECT_TRUE(Verifier.match("void f() noexcept;\n", loc(functionType()), - Language::Lang_CXX11)); + EXPECT_TRUE( + Verifier.match("void f() noexcept;\n", loc(functionType()), Lang_CXX11)); Verifier.expectRange(1, 10, 1, 24); EXPECT_TRUE(Verifier.match("void f() noexcept(false);\n", loc(functionType()), - Language::Lang_CXX11)); + Lang_CXX11)); Verifier.expectRange(1, 10, 1, 32); EXPECT_TRUE(Verifier.match("void f() noexcept(noexcept(1+1));\n", - loc(functionType()), Language::Lang_CXX11)); + loc(functionType()), Lang_CXX11)); ParmVarExceptionSpecRangeVerifier Verifier2; Verifier2.expectRange(1, 25, 1, 31); @@ -840,7 +838,7 @@ TEST(FunctionDecl, ExceptionSpecifications) { EXPECT_TRUE(Verifier2.match("void g(void (*fp)(void) noexcept(true));\n", parmVarDecl(hasType(pointerType(pointee( parenType(innerType(functionType())))))), - Language::Lang_CXX11)); + Lang_CXX11)); } TEST(Decl, MemberPointerStarLoc) { @@ -861,5 +859,4 @@ TEST(Decl, MemberPointerStarLoc) { ASSERT_EQ(SM.getFileOffset(TL.getStarLoc()), Example.point("star")); } -} // end namespace ast_matchers -} // end namespace clang +} // end namespace _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits