[PATCH] D76120: Refactor SourceLocationTest to `using namespace`
Marcel Hlopko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 13 01:33:11 PDT 2020
hlopko created this revision.
hlopko added a reviewer: gribozavr.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
hlopko updated this revision to Diff 250147.
hlopko added a comment.
Reformat
Only for the readability reasons.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D76120
Files:
clang/unittests/AST/SourceLocationTest.cpp
Index: clang/unittests/AST/SourceLocationTest.cpp
===================================================================
--- clang/unittests/AST/SourceLocationTest.cpp
+++ clang/unittests/AST/SourceLocationTest.cpp
@@ -23,8 +23,8 @@
#include "llvm/Testing/Support/Annotations.h"
#include "gtest/gtest.h"
-namespace clang {
-namespace ast_matchers {
+using namespace clang;
+using namespace clang::ast_matchers;
// FIXME: Pull the *Verifier tests into their own test file.
@@ -646,7 +646,7 @@
EXPECT_TRUE(Verifier.match(
"void f() noexcept(false);\n",
functionDecl(),
- Language::Lang_CXX11));
+ clang::ast_matchers::Language::Lang_CXX11));
}
class FunctionDeclParametersRangeVerifier : public RangeVerifier<FunctionDecl> {
@@ -773,7 +773,7 @@
"void f() noexcept(false);\n"
"};\n",
functionDecl(),
- Language::Lang_CXX11));
+ clang::ast_matchers::Language::Lang_CXX11));
}
class ExceptionSpecRangeVerifier : public RangeVerifier<TypeLoc> {
@@ -816,19 +816,20 @@
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, clang::ast_matchers::Language::Lang_CXX));
Verifier.expectRange(1, 10, 1, 10);
EXPECT_TRUE(Verifier.match("void f() noexcept;\n", loc(functionType()),
- Language::Lang_CXX11));
+ clang::ast_matchers::Language::Lang_CXX11));
Verifier.expectRange(1, 10, 1, 24);
EXPECT_TRUE(Verifier.match("void f() noexcept(false);\n", loc(functionType()),
- Language::Lang_CXX11));
+ clang::ast_matchers::Language::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()),
+ clang::ast_matchers::Language::Lang_CXX11));
ParmVarExceptionSpecRangeVerifier Verifier2;
Verifier2.expectRange(1, 25, 1, 31);
@@ -840,7 +841,7 @@
EXPECT_TRUE(Verifier2.match("void g(void (*fp)(void) noexcept(true));\n",
parmVarDecl(hasType(pointerType(pointee(
parenType(innerType(functionType())))))),
- Language::Lang_CXX11));
+ clang::ast_matchers::Language::Lang_CXX11));
}
TEST(Decl, MemberPointerStarLoc) {
@@ -859,6 +860,3 @@
auto TL = D->getTypeSourceInfo()->getTypeLoc().castAs<MemberPointerTypeLoc>();
ASSERT_EQ(SM.getFileOffset(TL.getStarLoc()), Example.point("star"));
}
-
-} // end namespace ast_matchers
-} // end namespace clang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76120.250147.patch
Type: text/x-patch
Size: 2873 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200313/bf5cc428/attachment-0001.bin>
More information about the cfe-commits
mailing list