diff options
-rw-r--r-- | lib/Sema/Sema.h | 2 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index f676304b2f..336dfa3763 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -2167,7 +2167,7 @@ public: AttributeList *AttrList); virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace); - NamespaceDecl *getStdNamespace(); + NamespaceDecl *getOrCreateStdNamespace(); virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope, SourceLocation UsingLoc, SourceLocation NamespcLoc, diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index d9215e5bbc..cf6e354f3c 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -3313,7 +3313,7 @@ void Sema::ActOnFinishNamespaceDef(DeclPtrTy D, SourceLocation RBrace) { /// \brief Retrieve the special "std" namespace, which may require us to /// implicitly define the namespace. -NamespaceDecl *Sema::getStdNamespace() { +NamespaceDecl *Sema::getOrCreateStdNamespace() { if (!StdNamespace) { // The "std" namespace has not yet been defined, so build one implicitly. StdNamespace = NamespaceDecl::Create(Context, @@ -3355,7 +3355,7 @@ Sema::DeclPtrTy Sema::ActOnUsingDirective(Scope *S, if ((!Qualifier || Qualifier->getKind() == NestedNameSpecifier::Global) && NamespcName->isStr("std")) { Diag(IdentLoc, diag::ext_using_undefined_std); - R.addDecl(getStdNamespace()); + R.addDecl(getOrCreateStdNamespace()); R.resolveKind(); } // Otherwise, attempt typo correction. diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index d9f7c13f3d..d607afac16 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -1199,7 +1199,7 @@ void Sema::DeclareGlobalNewDelete() { // The "std::bad_alloc" class has not yet been declared, so build it // implicitly. StdBadAlloc = CXXRecordDecl::Create(Context, TTK_Class, - getStdNamespace(), + getOrCreateStdNamespace(), SourceLocation(), &PP.getIdentifierTable().get("bad_alloc"), SourceLocation(), 0); |