diff options
author | Gor Nishanov <GorNishanov@gmail.com> | 2016-10-04 00:31:16 +0000 |
---|---|---|
committer | Gor Nishanov <GorNishanov@gmail.com> | 2016-10-04 00:31:16 +0000 |
commit | 3e048bb1405a30a500a0185bf04e4ffe278c8651 (patch) | |
tree | 32df6e1c0e3d0d264e03d6249674b6785f2aff4d /clang/lib/Sema/SemaCoroutine.cpp | |
parent | 3a7318f4903a6c3a91b667f33db91bf2ae7d4f88 (diff) | |
download | bcm5719-llvm-3e048bb1405a30a500a0185bf04e4ffe278c8651.tar.gz bcm5719-llvm-3e048bb1405a30a500a0185bf04e4ffe278c8651.zip |
[coroutines] Switch to using std::experimental namespace per P0057R5
Summary:
Look for coroutine_traits and friends in std::experimental namespace.
Patch (mostly) by EricWF.
Reviewers: cfe-commits, EricWF, rsmith
Subscribers: majnemer, mehdi_amini
Differential Revision: https://reviews.llvm.org/D25068
llvm-svn: 283170
Diffstat (limited to 'clang/lib/Sema/SemaCoroutine.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCoroutine.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp index 461ca8eddcf..f9c3970e021 100644 --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -26,15 +26,15 @@ using namespace sema; static QualType lookupPromiseType(Sema &S, const FunctionProtoType *FnType, SourceLocation Loc) { // FIXME: Cache std::coroutine_traits once we've found it. - NamespaceDecl *Std = S.getStdNamespace(); - if (!Std) { + NamespaceDecl *StdExp = S.lookupStdExperimentalNamespace(); + if (!StdExp) { S.Diag(Loc, diag::err_implied_std_coroutine_traits_not_found); return QualType(); } LookupResult Result(S, &S.PP.getIdentifierTable().get("coroutine_traits"), Loc, Sema::LookupOrdinaryName); - if (!S.LookupQualifiedName(Result, Std)) { + if (!S.LookupQualifiedName(Result, StdExp)) { S.Diag(Loc, diag::err_implied_std_coroutine_traits_not_found); return QualType(); } @@ -86,7 +86,7 @@ static QualType lookupPromiseType(Sema &S, const FunctionProtoType *FnType, QualType PromiseType = S.Context.getTypeDeclType(Promise); if (!PromiseType->getAsCXXRecordDecl()) { // Use the fully-qualified name of the type. - auto *NNS = NestedNameSpecifier::Create(S.Context, nullptr, Std); + auto *NNS = NestedNameSpecifier::Create(S.Context, nullptr, StdExp); NNS = NestedNameSpecifier::Create(S.Context, NNS, false, CoroTrait.getTypePtr()); PromiseType = S.Context.getElaboratedType(ETK_None, NNS, PromiseType); @@ -345,6 +345,7 @@ StmtResult Sema::ActOnCoreturnStmt(SourceLocation Loc, Expr *E) { } return BuildCoreturnStmt(Loc, E); } + StmtResult Sema::BuildCoreturnStmt(SourceLocation Loc, Expr *E) { auto *Coroutine = checkCoroutineContext(*this, Loc, "co_return"); if (!Coroutine) |