[PATCH] D76120: Refactor SourceLocationTest to `using namespace`
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 13 02:59:36 PDT 2020
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf8640737d476: Refactor SourceLocationTest to `using namespace` (authored by hlopko, committed by gribozavr).
Changed prior to commit:
https://reviews.llvm.org/D76120?vs=250163&id=250166#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76120/new/
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,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, 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, 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 @@
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 @@
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 @@
ASSERT_EQ(SM.getFileOffset(TL.getStarLoc()), Example.point("star"));
}
-} // end namespace ast_matchers
-} // end namespace clang
+} // end namespace
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76120.250166.patch
Type: text/x-patch
Size: 3251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200313/56728afc/attachment-0001.bin>
More information about the cfe-commits
mailing list