diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-06-08 08:38:12 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-06-08 08:38:12 +0000 |
commit | b23b4992370221b27d64fa5b1da01a52aa271bef (patch) | |
tree | 9e75ef10ad41e4a485a12e26383248f7f6f0e3ed /unittests/Sema | |
parent | 085452490f953a5bb7b54827d99276029be1b6c6 (diff) |
[C++11] Use 'nullptr'. Unittests edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Sema')
-rw-r--r-- | unittests/Sema/ExternalSemaSourceTest.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/unittests/Sema/ExternalSemaSourceTest.cpp b/unittests/Sema/ExternalSemaSourceTest.cpp index 7cb5af1f13..bc0d632cfd 100644 --- a/unittests/Sema/ExternalSemaSourceTest.cpp +++ b/unittests/Sema/ExternalSemaSourceTest.cpp @@ -49,7 +49,7 @@ class NamespaceDiagnosticWatcher : public clang::DiagnosticConsumer { public: NamespaceDiagnosticWatcher(StringRef From, StringRef To) - : Chained(NULL), FromNS(From), ToNS("'"), SeenCount(0) { + : Chained(nullptr), FromNS(From), ToNS("'"), SeenCount(0) { ToNS.append(To); ToNS.append("'"); } @@ -95,11 +95,11 @@ class NamespaceTypoProvider : public clang::ExternalSemaSource { public: NamespaceTypoProvider(StringRef From, StringRef To) - : CorrectFrom(From), CorrectTo(To), CurrentSema(NULL), CallCount(0) {} + : CorrectFrom(From), CorrectTo(To), CurrentSema(nullptr), CallCount(0) {} virtual void InitializeSema(Sema &S) { CurrentSema = &S; } - virtual void ForgetSema() { CurrentSema = NULL; } + virtual void ForgetSema() { CurrentSema = nullptr; } virtual TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, int LookupKind, Scope *S, CXXScopeSpec *SS, @@ -109,17 +109,17 @@ public: const ObjCObjectPointerType *OPT) { ++CallCount; if (CurrentSema && Typo.getName().getAsString() == CorrectFrom) { - DeclContext *DestContext = NULL; + DeclContext *DestContext = nullptr; ASTContext &Context = CurrentSema->getASTContext(); - if (SS != NULL) + if (SS) DestContext = CurrentSema->computeDeclContext(*SS, EnteringContext); - if (DestContext == NULL) + if (!DestContext) DestContext = Context.getTranslationUnitDecl(); IdentifierInfo *ToIdent = CurrentSema->getPreprocessor().getIdentifierInfo(CorrectTo); NamespaceDecl *NewNamespace = NamespaceDecl::Create(Context, DestContext, false, Typo.getBeginLoc(), - Typo.getLoc(), ToIdent, NULL); + Typo.getLoc(), ToIdent, nullptr); DestContext->addDecl(NewNamespace); TypoCorrection Correction(ToIdent); Correction.addCorrectionDecl(NewNamespace); @@ -149,7 +149,7 @@ protected: virtual void ExecuteAction() { CompilerInstance &CI = getCompilerInstance(); ASSERT_FALSE(CI.hasSema()); - CI.createSema(getTranslationUnitKind(), NULL); + CI.createSema(getTranslationUnitKind(), nullptr); ASSERT_TRUE(CI.hasDiagnostics()); DiagnosticsEngine &Diagnostics = CI.getDiagnostics(); DiagnosticConsumer *Client = Diagnostics.getClient(); |