Index: clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-identifier-naming/system/coroutines.h =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-identifier-naming/system/coroutines.h +++ clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-identifier-naming/system/coroutines.h @@ -1,7 +1,6 @@ #pragma once namespace std { -namespace experimental { template struct coroutine_traits { @@ -13,7 +12,6 @@ static constexpr coroutine_handle from_address(void *addr) noexcept { return {}; }; }; -} // namespace experimental } // namespace std struct never_suspend { Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -2872,7 +2872,7 @@ Clang provides experimental builtins to support C++ Coroutines as defined by https://wg21.link/P0057. The following four are intended to be used by the -standard library to implement `std::experimental::coroutine_handle` type. +standard library to implement `std::coroutine_handle` type. **Syntax**: Index: clang/include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticSemaKinds.td +++ clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -10955,7 +10955,7 @@ "|a function with a deduced return type|a varargs function" "|a consteval function}0">; def err_implied_coroutine_type_not_found : Error< - "%0 type was not found; include before defining " + "%0 type was not found; include before defining " "a coroutine">; def err_implicit_coroutine_std_nothrow_type_not_found : Error< "std::nothrow was not found; include before defining a coroutine which " @@ -10963,11 +10963,11 @@ def err_malformed_std_nothrow : Error< "std::nothrow must be a valid variable declaration">; def err_malformed_std_coroutine_handle : Error< - "std::experimental::coroutine_handle must be a class template">; + "std::coroutine_handle must be a class template">; def err_coroutine_handle_missing_member : Error< - "std::experimental::coroutine_handle missing a member named '%0'">; + "std::coroutine_handle missing a member named '%0'">; def err_malformed_std_coroutine_traits : Error< - "'std::experimental::coroutine_traits' must be a class template">; + "'std::coroutine_traits' must be a class template">; def err_implied_std_coroutine_traits_promise_type_not_found : Error< "this function cannot be a coroutine: %q0 has no member named 'promise_type'">; def err_implied_std_coroutine_traits_promise_type_not_class : Error< Index: clang/include/clang/Sema/Sema.h =================================================================== --- clang/include/clang/Sema/Sema.h +++ clang/include/clang/Sema/Sema.h @@ -5655,8 +5655,6 @@ NamespaceDecl *getStdNamespace() const; NamespaceDecl *getOrCreateStdNamespace(); - NamespaceDecl *lookupStdExperimentalNamespace(); - CXXRecordDecl *getStdBadAlloc() const; EnumDecl *getStdAlignValT() const; Index: clang/lib/Sema/SemaCoroutine.cpp =================================================================== --- clang/lib/Sema/SemaCoroutine.cpp +++ clang/lib/Sema/SemaCoroutine.cpp @@ -54,10 +54,10 @@ const FunctionProtoType *FnType = FD->getType()->castAs(); const SourceLocation FuncLoc = FD->getLocation(); // FIXME: Cache std::coroutine_traits once we've found it. - NamespaceDecl *StdExp = S.lookupStdExperimentalNamespace(); - if (!StdExp) { + NamespaceDecl *Std = S.getStdNamespace(); + if (!Std) { S.Diag(KwLoc, diag::err_implied_coroutine_type_not_found) - << "std::experimental::coroutine_traits"; + << "std::coroutine_traits"; return QualType(); } @@ -122,7 +122,7 @@ QualType PromiseType = S.Context.getTypeDeclType(Promise); auto buildElaboratedType = [&]() { - auto *NNS = NestedNameSpecifier::Create(S.Context, nullptr, StdExp); + auto *NNS = NestedNameSpecifier::Create(S.Context, nullptr, Std); NNS = NestedNameSpecifier::Create(S.Context, NNS, false, CoroTrait.getTypePtr()); return S.Context.getElaboratedType(ETK_None, NNS, PromiseType); @@ -141,20 +141,20 @@ return PromiseType; } -/// Look up the std::experimental::coroutine_handle. +/// Look up the std::coroutine_handle. static QualType lookupCoroutineHandleType(Sema &S, QualType PromiseType, SourceLocation Loc) { if (PromiseType.isNull()) return QualType(); - NamespaceDecl *StdExp = S.lookupStdExperimentalNamespace(); - assert(StdExp && "Should already be diagnosed"); + NamespaceDecl *Std = S.getStdNamespace(); + assert(Std && "Should already be diagnosed"); LookupResult Result(S, &S.PP.getIdentifierTable().get("coroutine_handle"), Loc, Sema::LookupOrdinaryName); - if (!S.LookupQualifiedName(Result, StdExp)) { + if (!S.LookupQualifiedName(Result, Std)) { S.Diag(Loc, diag::err_implied_coroutine_type_not_found) - << "std::experimental::coroutine_handle"; + << "std::coroutine_handle"; return QualType(); } @@ -1000,7 +1000,7 @@ LookupResult Result(S, &S.PP.getIdentifierTable().get("nothrow"), Loc, Sema::LookupOrdinaryName); if (!S.LookupQualifiedName(Result, Std)) { - // FIXME: should have been included already. + // FIXME: should have been included already. // If we require it to include then this diagnostic is no longer // needed. S.Diag(Loc, diag::err_implicit_coroutine_std_nothrow_type_not_found); @@ -1665,13 +1665,13 @@ ClassTemplateDecl *Sema::lookupCoroutineTraits(SourceLocation KwLoc, SourceLocation FuncLoc) { if (!StdCoroutineTraitsCache) { - if (auto StdExp = lookupStdExperimentalNamespace()) { + if (auto Std = getStdNamespace()) { LookupResult Result(*this, &PP.getIdentifierTable().get("coroutine_traits"), FuncLoc, LookupOrdinaryName); - if (!LookupQualifiedName(Result, StdExp)) { + if (!LookupQualifiedName(Result, Std)) { Diag(KwLoc, diag::err_implied_coroutine_type_not_found) - << "std::experimental::coroutine_traits"; + << "std::coroutine_traits"; return nullptr; } if (!(StdCoroutineTraitsCache = Index: clang/lib/Sema/SemaDeclCXX.cpp =================================================================== --- clang/lib/Sema/SemaDeclCXX.cpp +++ clang/lib/Sema/SemaDeclCXX.cpp @@ -11123,20 +11123,6 @@ StdNamespace.get(Context.getExternalSource())); } -NamespaceDecl *Sema::lookupStdExperimentalNamespace() { - if (!StdExperimentalNamespaceCache) { - if (auto Std = getStdNamespace()) { - LookupResult Result(*this, &PP.getIdentifierTable().get("experimental"), - SourceLocation(), LookupNamespaceName); - if (!LookupQualifiedName(Result, Std) || - !(StdExperimentalNamespaceCache = - Result.getAsSingle())) - Result.suppressDiagnostics(); - } - } - return StdExperimentalNamespaceCache; -} - namespace { enum UnsupportedSTLSelect { Index: clang/test/AST/Inputs/std-coroutine.h =================================================================== --- clang/test/AST/Inputs/std-coroutine.h +++ clang/test/AST/Inputs/std-coroutine.h @@ -3,7 +3,6 @@ #define STD_COROUTINE_H namespace std { -namespace experimental { template struct coroutine_traits { using promise_type = typename R::promise_type; @@ -67,7 +66,6 @@ void await_resume() noexcept {} }; -} // namespace experimental } // namespace std #endif // STD_COROUTINE_H Index: clang/test/AST/coroutine-locals-cleanup.cpp =================================================================== --- clang/test/AST/coroutine-locals-cleanup.cpp +++ clang/test/AST/coroutine-locals-cleanup.cpp @@ -2,7 +2,7 @@ #include "Inputs/std-coroutine.h" -using namespace std::experimental; +using namespace std; struct Task { struct promise_type { Index: clang/test/AST/coroutine-source-location-crash.cpp =================================================================== --- clang/test/AST/coroutine-source-location-crash.cpp +++ clang/test/AST/coroutine-source-location-crash.cpp @@ -11,7 +11,7 @@ #include "Inputs/std-coroutine.h" -using namespace std::experimental; +using namespace std; struct A { bool await_ready(); Index: clang/test/Analysis/more-dtors-cfg-output.cpp =================================================================== --- clang/test/Analysis/more-dtors-cfg-output.cpp +++ clang/test/Analysis/more-dtors-cfg-output.cpp @@ -275,32 +275,32 @@ #if CXX2A // Boilerplate needed to test co_return: -namespace std::experimental { - template - struct coroutine_handle { - static coroutine_handle from_address(void *) noexcept; - }; -} +namespace std { +template +struct coroutine_handle { + static coroutine_handle from_address(void *) noexcept; +}; +} // namespace std struct TestPromise { TestPromise initial_suspend(); TestPromise final_suspend() noexcept; bool await_ready() noexcept; - void await_suspend(const std::experimental::coroutine_handle &) noexcept; + void await_suspend(const std::coroutine_handle &) noexcept; void await_resume() noexcept; Foo return_value(const Bar &); Bar get_return_object(); void unhandled_exception(); }; -namespace std::experimental { - template - struct coroutine_traits; - template <> - struct coroutine_traits { - using promise_type = TestPromise; - }; -} +namespace std { +template +struct coroutine_traits; +template <> +struct coroutine_traits { + using promise_type = TestPromise; +}; +} // namespace std Bar coreturn() { co_return get_bar(); Index: clang/test/CodeGenCXX/ubsan-coroutines.cpp =================================================================== --- clang/test/CodeGenCXX/ubsan-coroutines.cpp +++ clang/test/CodeGenCXX/ubsan-coroutines.cpp @@ -4,7 +4,7 @@ // llvm.coro.* intrinsics have not yet been ported. // RUN: %clang_cc1 -fno-experimental-new-pass-manager -emit-obj -std=c++2a -fsanitize=null %s -o %t.o -namespace std::experimental { +namespace std { template struct coroutine_traits { using promise_type = typename R::promise_type; }; @@ -20,11 +20,11 @@ coroutine_handle() = default; static coroutine_handle from_address(void *) noexcept; }; -} +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; @@ -41,7 +41,7 @@ struct awaitable { task await() { (void)co_await *this; } bool await_ready() { return false; } - bool await_suspend(std::experimental::coroutine_handle<> awaiter) { return false; } + bool await_suspend(std::coroutine_handle<> awaiter) { return false; } bool await_resume() { return false; } }; Index: clang/test/CodeGenCoroutines/Inputs/coroutine.h =================================================================== --- clang/test/CodeGenCoroutines/Inputs/coroutine.h +++ clang/test/CodeGenCoroutines/Inputs/coroutine.h @@ -1,6 +1,6 @@ #pragma once -namespace std { namespace experimental { inline namespace coroutines_v1 { +namespace std { template struct coroutine_traits { using promise_type = typename R::promise_type; @@ -77,4 +77,4 @@ void await_resume() noexcept {} }; -}}} +} // namespace std Index: clang/test/CodeGenCoroutines/coro-alloc.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-alloc.cpp +++ clang/test/CodeGenCoroutines/coro-alloc.cpp @@ -3,7 +3,6 @@ // RUN: | FileCheck %s namespace std { -namespace experimental { template struct coroutine_traits; // expected-note {{declared here}} @@ -21,8 +20,6 @@ coroutine_handle(coroutine_handle) noexcept {} }; -} // end namespace experimental - struct nothrow_t {}; constexpr nothrow_t nothrow = {}; @@ -37,14 +34,14 @@ struct suspend_always { bool await_ready() noexcept { return false; } - void await_suspend(std::experimental::coroutine_handle<>) noexcept {} + void await_suspend(std::coroutine_handle<>) noexcept {} void await_resume() noexcept {} }; struct global_new_delete_tag {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void get_return_object() {} suspend_always initial_suspend() { return {}; } @@ -83,8 +80,8 @@ struct promise_new_tag {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void *operator new(unsigned long); void get_return_object() {} @@ -98,7 +95,7 @@ extern "C" void f1(promise_new_tag ) { // CHECK: %[[ID:.+]] = call token @llvm.coro.id(i32 16 // CHECK: %[[SIZE:.+]] = call i64 @llvm.coro.size.i64() - // CHECK: call i8* @_ZNSt12experimental16coroutine_traitsIJv15promise_new_tagEE12promise_typenwEm(i64 %[[SIZE]]) + // CHECK: call i8* @_ZNSt16coroutine_traitsIJv15promise_new_tagEE12promise_typenwEm(i64 %[[SIZE]]) // CHECK: %[[FRAME:.+]] = call i8* @llvm.coro.begin( // CHECK: %[[MEM:.+]] = call i8* @llvm.coro.free(token %[[ID]], i8* %[[FRAME]]) @@ -108,8 +105,8 @@ struct promise_matching_placement_new_tag {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void *operator new(unsigned long, promise_matching_placement_new_tag, int, float, double); @@ -130,7 +127,7 @@ // CHECK: %[[INT:.+]] = load i32, i32* %x.addr, align 4 // CHECK: %[[FLOAT:.+]] = load float, float* %y.addr, align 4 // CHECK: %[[DOUBLE:.+]] = load double, double* %z.addr, align 8 - // CHECK: call i8* @_ZNSt12experimental16coroutine_traitsIJv34promise_matching_placement_new_tagifdEE12promise_typenwEmS1_ifd(i64 %[[SIZE]], i32 %[[INT]], float %[[FLOAT]], double %[[DOUBLE]]) + // CHECK: call i8* @_ZNSt16coroutine_traitsIJv34promise_matching_placement_new_tagifdEE12promise_typenwEmS0_ifd(i64 %[[SIZE]], i32 %[[INT]], float %[[FLOAT]], double %[[DOUBLE]]) co_return; } @@ -140,8 +137,8 @@ struct promise_matching_global_placement_new_tag {}; struct dummy {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void get_return_object() {} suspend_always initial_suspend() { return {}; } @@ -162,8 +159,8 @@ struct promise_delete_tag {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void operator delete(void*); void get_return_object() {} @@ -181,14 +178,14 @@ // CHECK: %[[FRAME:.+]] = call i8* @llvm.coro.begin( // CHECK: %[[MEM:.+]] = call i8* @llvm.coro.free(token %[[ID]], i8* %[[FRAME]]) - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJv18promise_delete_tagEE12promise_typedlEPv(i8* %[[MEM]]) + // CHECK: call void @_ZNSt16coroutine_traitsIJv18promise_delete_tagEE12promise_typedlEPv(i8* %[[MEM]]) co_return; } struct promise_sized_delete_tag {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void operator delete(void*, unsigned long); void get_return_object() {} @@ -207,14 +204,14 @@ // CHECK: %[[FRAME:.+]] = call i8* @llvm.coro.begin( // CHECK: %[[MEM:.+]] = call i8* @llvm.coro.free(token %[[ID]], i8* %[[FRAME]]) // CHECK: %[[SIZE2:.+]] = call i64 @llvm.coro.size.i64() - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJv24promise_sized_delete_tagEE12promise_typedlEPvm(i8* %[[MEM]], i64 %[[SIZE2]]) + // CHECK: call void @_ZNSt16coroutine_traitsIJv24promise_sized_delete_tagEE12promise_typedlEPvm(i8* %[[MEM]], i64 %[[SIZE2]]) co_return; } struct promise_on_alloc_failure_tag {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { int get_return_object() { return 0; } suspend_always initial_suspend() { return {}; } @@ -235,12 +232,12 @@ // CHECK: br i1 %[[OK]], label %[[OKBB:.+]], label %[[ERRBB:.+]] // CHECK: [[ERRBB]]: - // CHECK: %[[FailRet:.+]] = call i32 @_ZNSt12experimental16coroutine_traitsIJi28promise_on_alloc_failure_tagEE12promise_type39get_return_object_on_allocation_failureEv( + // CHECK: %[[FailRet:.+]] = call i32 @_ZNSt16coroutine_traitsIJi28promise_on_alloc_failure_tagEE12promise_type39get_return_object_on_allocation_failureEv( // CHECK: store i32 %[[FailRet]], i32* %[[RetVal]] // CHECK: br label %[[RetBB:.+]] // CHECK: [[OKBB]]: - // CHECK: %[[OkRet:.+]] = call i32 @_ZNSt12experimental16coroutine_traitsIJi28promise_on_alloc_failure_tagEE12promise_type17get_return_objectEv( + // CHECK: %[[OkRet:.+]] = call i32 @_ZNSt16coroutine_traitsIJi28promise_on_alloc_failure_tagEE12promise_type17get_return_objectEv( // CHECK: store i32 %[[OkRet]], i32* %[[Gro]] // CHECK: %[[Tmp1:.*]] = load i32, i32* %[[Gro]] Index: clang/test/CodeGenCoroutines/coro-always-inline.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-always-inline.cpp +++ clang/test/CodeGenCoroutines/coro-always-inline.cpp @@ -9,7 +9,6 @@ // RUN: -fno-inline -O0 %s -o - | FileCheck %s namespace std { -namespace experimental { struct handle {}; @@ -35,18 +34,17 @@ void unhandled_exception() {} }; }; -} // namespace experimental } // namespace std // CHECK-LABEL: @_Z3foov // CHECK-LABEL: entry: -// CHECK: [[CAST0:%[0-9]+]] = bitcast %"struct.std::experimental::awaitable"* %ref.tmp{{.*}} to i8* +// CHECK: [[CAST0:%[0-9]+]] = bitcast %"struct.std::awaitable"* %ref.tmp{{.*}} to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 1, i8* [[CAST0]]) -// CHECK: [[CAST1:%[0-9]+]] = bitcast %"struct.std::experimental::awaitable"* %ref.tmp{{.*}} to i8* +// CHECK: [[CAST1:%[0-9]+]] = bitcast %"struct.std::awaitable"* %ref.tmp{{.*}} to i8* // CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 1, i8* [[CAST1]]) -// CHECK: [[CAST2:%[0-9]+]] = bitcast %"struct.std::experimental::awaitable"* %ref.tmp{{.*}} to i8* +// CHECK: [[CAST2:%[0-9]+]] = bitcast %"struct.std::awaitable"* %ref.tmp{{.*}} to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 1, i8* [[CAST2]]) -// CHECK: [[CAST3:%[0-9]+]] = bitcast %"struct.std::experimental::awaitable"* %ref.tmp{{.*}} to i8* +// CHECK: [[CAST3:%[0-9]+]] = bitcast %"struct.std::awaitable"* %ref.tmp{{.*}} to i8* // CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 1, i8* [[CAST3]]) void foo() { co_return; } Index: clang/test/CodeGenCoroutines/coro-await-domination.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-await-domination.cpp +++ clang/test/CodeGenCoroutines/coro-await-domination.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcoroutines-ts -std=c++14 -emit-llvm %s -o - | FileCheck %s #include "Inputs/coroutine.h" -using namespace std::experimental; +using namespace std; struct coro { struct promise_type { Index: clang/test/CodeGenCoroutines/coro-await-resume-eh.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-await-resume-eh.cpp +++ clang/test/CodeGenCoroutines/coro-await-resume-eh.cpp @@ -10,11 +10,9 @@ #include "Inputs/coroutine.h" -namespace coro = std::experimental::coroutines_v1; - struct throwing_awaitable { bool await_ready() { return true; } - void await_suspend(coro::coroutine_handle<>) {} + void await_suspend(std::coroutine_handle<>) {} void await_resume() { throw 42; } }; @@ -22,7 +20,7 @@ struct promise_type { auto get_return_object() { return throwing_task{}; } auto initial_suspend() { return throwing_awaitable{}; } - auto final_suspend() noexcept { return coro::suspend_never{}; } + auto final_suspend() noexcept { return std::suspend_never{}; } void return_void() {} void unhandled_exception() {} }; @@ -88,7 +86,7 @@ struct noexcept_awaitable { bool await_ready() { return true; } - void await_suspend(coro::coroutine_handle<>) {} + void await_suspend(std::coroutine_handle<>) {} void await_resume() noexcept {} }; @@ -96,7 +94,7 @@ struct promise_type { auto get_return_object() { return noexcept_task{}; } auto initial_suspend() { return noexcept_awaitable{}; } - auto final_suspend() noexcept { return coro::suspend_never{}; } + auto final_suspend() noexcept { return std::suspend_never{}; } void return_void() {} void unhandled_exception() {} }; Index: clang/test/CodeGenCoroutines/coro-await.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-await.cpp +++ clang/test/CodeGenCoroutines/coro-await.cpp @@ -2,7 +2,6 @@ // RUN: -emit-llvm %s -o - -disable-llvm-passes -Wno-coroutine -Wno-unused | FileCheck %s namespace std { -namespace experimental { template struct coroutine_traits; @@ -20,29 +19,28 @@ static coroutine_handle from_address(void *) noexcept; }; -} } struct init_susp { bool await_ready(); - void await_suspend(std::experimental::coroutine_handle<>); + void await_suspend(std::coroutine_handle<>); void await_resume(); }; struct final_susp { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; struct suspend_always { int stuff; bool await_ready(); - void await_suspend(std::experimental::coroutine_handle<>); + void await_suspend(std::coroutine_handle<>); void await_resume(); }; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void get_return_object(); init_susp initial_suspend(); @@ -57,7 +55,7 @@ // See if initial_suspend was issued: // ---------------------------------- - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJvEE12promise_type15initial_suspendEv( + // CHECK: call void @_ZNSt16coroutine_traitsIJvEE12promise_type15initial_suspendEv( // CHECK-NEXT: call zeroext i1 @_ZN9init_susp11await_readyEv(%struct.init_susp* // CHECK: %[[INITSP_ID:.+]] = call token @llvm.coro.save( // CHECK: call i8 @llvm.coro.suspend(token %[[INITSP_ID]], i1 false) @@ -75,10 +73,10 @@ // --------------------------- // Build the coroutine handle and pass it to await_suspend // --------------------------- - // CHECK: call i8* @_ZNSt12experimental16coroutine_handleINS_16coroutine_traitsIJvEE12promise_typeEE12from_addressEPv(i8* %[[FRAME]]) + // CHECK: call i8* @_ZNSt16coroutine_handleINSt16coroutine_traitsIJvEE12promise_typeEE12from_addressEPv(i8* %[[FRAME]]) // ... many lines of code to coerce coroutine_handle into an i8* scalar // CHECK: %[[CH:.+]] = load i8*, i8** %{{.+}} - // CHECK: call void @_ZN14suspend_always13await_suspendENSt12experimental16coroutine_handleIvEE(%struct.suspend_always* {{[^,]*}} %[[AWAITABLE]], i8* %[[CH]]) + // CHECK: call void @_ZN14suspend_always13await_suspendESt16coroutine_handleIvE(%struct.suspend_always* {{[^,]*}} %[[AWAITABLE]], i8* %[[CH]]) // ------------------------- // Generate a suspend point: // ------------------------- @@ -99,7 +97,7 @@ // See if final_suspend was issued: // ---------------------------------- - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJvEE12promise_type13final_suspendEv( + // CHECK: call void @_ZNSt16coroutine_traitsIJvEE12promise_type13final_suspendEv( // CHECK-NEXT: call zeroext i1 @_ZN10final_susp11await_readyEv(%struct.final_susp* // CHECK: %[[FINALSP_ID:.+]] = call token @llvm.coro.save( // CHECK: call i8 @llvm.coro.suspend(token %[[FINALSP_ID]], i1 true) @@ -109,13 +107,12 @@ float stuff; ~suspend_maybe(); bool await_ready(); - bool await_suspend(std::experimental::coroutine_handle<>); + bool await_suspend(std::coroutine_handle<>); void await_resume(); }; - -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void get_return_object(); init_susp initial_suspend(); @@ -127,10 +124,10 @@ // CHECK-LABEL: f1( extern "C" void f1(int) { - // CHECK: %[[PROMISE:.+]] = alloca %"struct.std::experimental::coroutine_traits::promise_type" + // CHECK: %[[PROMISE:.+]] = alloca %"struct.std::coroutine_traits::promise_type" // CHECK: %[[FRAME:.+]] = call i8* @llvm.coro.begin( co_yield 42; - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJviEE12promise_type11yield_valueEi(%struct.suspend_maybe* sret(%struct.suspend_maybe) align 4 %[[AWAITER:.+]], %"struct.std::experimental::coroutine_traits::promise_type"* {{[^,]*}} %[[PROMISE]], i32 42) + // CHECK: call void @_ZNSt16coroutine_traitsIJviEE12promise_type11yield_valueEi(%struct.suspend_maybe* sret(%struct.suspend_maybe) align 4 %[[AWAITER:.+]], %"struct.std::coroutine_traits::promise_type"* {{[^,]*}} %[[PROMISE]], i32 42) // See if we need to suspend: // -------------------------- @@ -144,10 +141,10 @@ // --------------------------- // Build the coroutine handle and pass it to await_suspend // --------------------------- - // CHECK: call i8* @_ZNSt12experimental16coroutine_handleINS_16coroutine_traitsIJviEE12promise_typeEE12from_addressEPv(i8* %[[FRAME]]) + // CHECK: call i8* @_ZNSt16coroutine_handleINSt16coroutine_traitsIJviEE12promise_typeEE12from_addressEPv(i8* %[[FRAME]]) // ... many lines of code to coerce coroutine_handle into an i8* scalar // CHECK: %[[CH:.+]] = load i8*, i8** %{{.+}} - // CHECK: %[[YES:.+]] = call zeroext i1 @_ZN13suspend_maybe13await_suspendENSt12experimental16coroutine_handleIvEE(%struct.suspend_maybe* {{[^,]*}} %[[AWAITABLE]], i8* %[[CH]]) + // CHECK: %[[YES:.+]] = call zeroext i1 @_ZN13suspend_maybe13await_suspendESt16coroutine_handleIvE(%struct.suspend_maybe* {{[^,]*}} %[[AWAITABLE]], i8* %[[CH]]) // ------------------------------------------- // See if await_suspend decided not to suspend // ------------------------------------------- @@ -264,7 +261,7 @@ // See if initial_suspend was issued: // ---------------------------------- - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJvEE12promise_type15initial_suspendEv( + // CHECK: call void @_ZNSt16coroutine_traitsIJvEE12promise_type15initial_suspendEv( // CHECK-NEXT: call zeroext i1 @_ZN9init_susp11await_readyEv(%struct.init_susp* for (;;) @@ -272,7 +269,7 @@ // Verify that final_suspend was NOT issued: // ---------------------------------- - // CHECK-NOT: call void @_ZNSt12experimental16coroutine_traitsIJvEE12promise_type13final_suspendEv( + // CHECK-NOT: call void @_ZNSt16coroutine_traitsIJvEE12promise_type13final_suspendEv( // CHECK-NOT: call zeroext i1 @_ZN10final_susp11await_readyEv(%struct.final_susp* } @@ -287,13 +284,12 @@ struct AwaitResumeReturnsLValue { bool await_ready(); - void await_suspend(std::experimental::coroutine_handle<>); + void await_suspend(std::coroutine_handle<>); RefTag& await_resume(); }; - -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void get_return_object(); init_susp initial_suspend(); @@ -338,7 +334,7 @@ struct TailCallAwait { bool await_ready(); - std::experimental::coroutine_handle<> await_suspend(std::experimental::coroutine_handle<>); + std::coroutine_handle<> await_suspend(std::coroutine_handle<>); void await_resume(); }; @@ -346,9 +342,9 @@ extern "C" void TestTailcall() { co_await TailCallAwait{}; - // CHECK: %[[RESULT:.+]] = call i8* @_ZN13TailCallAwait13await_suspendENSt12experimental16coroutine_handleIvEE(%struct.TailCallAwait* - // CHECK: %[[COERCE:.+]] = getelementptr inbounds %"struct.std::experimental::coroutine_handle", %"struct.std::experimental::coroutine_handle"* %[[TMP:.+]], i32 0, i32 0 + // CHECK: %[[RESULT:.+]] = call i8* @_ZN13TailCallAwait13await_suspendESt16coroutine_handleIvE(%struct.TailCallAwait* + // CHECK: %[[COERCE:.+]] = getelementptr inbounds %"struct.std::coroutine_handle", %"struct.std::coroutine_handle"* %[[TMP:.+]], i32 0, i32 0 // CHECK: store i8* %[[RESULT]], i8** %[[COERCE]] - // CHECK: %[[ADDR:.+]] = call i8* @_ZNSt12experimental16coroutine_handleIvE7addressEv(%"struct.std::experimental::coroutine_handle"* {{[^,]*}} %[[TMP]]) + // CHECK: %[[ADDR:.+]] = call i8* @_ZNSt16coroutine_handleIvE7addressEv(%"struct.std::coroutine_handle"* {{[^,]*}} %[[TMP]]) // CHECK: call void @llvm.coro.resume(i8* %[[ADDR]]) } Index: clang/test/CodeGenCoroutines/coro-cleanup.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-cleanup.cpp +++ clang/test/CodeGenCoroutines/coro-cleanup.cpp @@ -1,7 +1,7 @@ // Verify that coroutine promise and allocated memory are freed up on exception. // RUN: %clang_cc1 -std=c++1z -fcoroutines-ts -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -fexceptions -fcxx-exceptions -disable-llvm-passes | FileCheck %s -namespace std::experimental { +namespace std { template struct coroutine_traits; template struct coroutine_handle { @@ -14,15 +14,15 @@ template coroutine_handle(coroutine_handle) noexcept; }; -} +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; -template <> struct std::experimental::coroutine_traits { +template <> struct std::coroutine_traits { struct promise_type { void get_return_object() noexcept; suspend_always initial_suspend() noexcept; @@ -43,7 +43,7 @@ // If promise constructor throws, check that we free the memory. - // CHECK: invoke void @_ZNSt12experimental16coroutine_traitsIJvEE12promise_typeC1Ev( + // CHECK: invoke void @_ZNSt16coroutine_traitsIJvEE12promise_typeC1Ev( // CHECK-NEXT: to label %{{.+}} unwind label %[[DeallocPad:.+]] // CHECK: [[DeallocPad]]: @@ -67,7 +67,7 @@ // CHECK: [[Catch]]: // CHECK: call i8* @__cxa_begin_catch( - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJvEE12promise_type19unhandled_exceptionEv( + // CHECK: call void @_ZNSt16coroutine_traitsIJvEE12promise_type19unhandled_exceptionEv( // CHECK: invoke void @__cxa_end_catch() // CHECK-NEXT: to label %[[Cont:.+]] unwind @@ -77,7 +77,7 @@ // CHECK-NEXT: br label %[[Cleanup:.+]] // CHECK: [[Cleanup]]: - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJvEE12promise_typeD1Ev( + // CHECK: call void @_ZNSt16coroutine_traitsIJvEE12promise_typeD1Ev( // CHECK: %[[Mem0:.+]] = call i8* @llvm.coro.free( // CHECK: call void @_ZdlPv(i8* %[[Mem0]] @@ -93,5 +93,5 @@ for (;;) co_await suspend_always{}; // Since this is the endless loop there should be no fallthrough handler (call to 'return_void'). - // CHECK-NOT: call void @_ZNSt12experimental16coroutine_traitsIJvEE12promise_type11return_voidEv + // CHECK-NOT: call void @_ZNSt16coroutine_traitsIJvEE12promise_type11return_voidEv } Index: clang/test/CodeGenCoroutines/coro-dest-slot.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-dest-slot.cpp +++ clang/test/CodeGenCoroutines/coro-dest-slot.cpp @@ -2,7 +2,7 @@ #include "Inputs/coroutine.h" -using namespace std::experimental; +using namespace std; struct coro { struct promise_type { @@ -30,7 +30,7 @@ // CHECK-NEXT: i8 1, label %[[FINAL_CLEANUP:.+]] // CHECK-NEXT: ] -// CHECK: call void @_ZNSt12experimental13coroutines_v113suspend_never12await_resumeEv( +// CHECK: call void @_ZNSt13suspend_never12await_resumeEv( // CHECK: %[[CLEANUP_DEST1:.+]] = phi i32 [ 0, %[[FINAL_READY]] ], [ 2, %[[FINAL_CLEANUP]] ] // CHECK: %[[CLEANUP_DEST2:.+]] = phi i32 [ %[[CLEANUP_DEST0]], %{{.+}} ], [ %[[CLEANUP_DEST1]], %{{.+}} ], [ 0, %{{.+}} ] // CHECK: call i8* @llvm.coro.free( Index: clang/test/CodeGenCoroutines/coro-dwarf.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-dwarf.cpp +++ clang/test/CodeGenCoroutines/coro-dwarf.cpp @@ -3,7 +3,7 @@ // RUN: -emit-llvm -o - %s | \ // RUN: FileCheck %s --implicit-check-not=DILocalVariable -namespace std::experimental { +namespace std { template struct coroutine_traits; template struct coroutine_handle { @@ -16,15 +16,15 @@ template coroutine_handle(coroutine_handle) noexcept; }; -} // namespace std::experimental +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; -template struct std::experimental::coroutine_traits { +template struct std::coroutine_traits { struct promise_type { void get_return_object() noexcept; suspend_always initial_suspend() noexcept; Index: clang/test/CodeGenCoroutines/coro-eh-cleanup.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-eh-cleanup.cpp +++ clang/test/CodeGenCoroutines/coro-eh-cleanup.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -std=c++1z -fcoroutines-ts -triple=x86_64-pc-windows-msvc18.0.0 -emit-llvm %s -o - -fexceptions -fcxx-exceptions -disable-llvm-passes | FileCheck %s // RUN: %clang_cc1 -std=c++1z -fcoroutines-ts -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -fexceptions -fcxx-exceptions -disable-llvm-passes | FileCheck --check-prefix=CHECK-LPAD %s -namespace std::experimental { +namespace std { template struct coroutine_traits { using promise_type = typename R::promise_type; }; @@ -18,11 +18,11 @@ coroutine_handle() = default; static coroutine_handle from_address(void *) noexcept; }; -} +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; Index: clang/test/CodeGenCoroutines/coro-gro-nrvo.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-gro-nrvo.cpp +++ clang/test/CodeGenCoroutines/coro-gro-nrvo.cpp @@ -2,7 +2,7 @@ #include "Inputs/coroutine.h" -using namespace std::experimental; +using namespace std; namespace std { Index: clang/test/CodeGenCoroutines/coro-gro.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-gro.cpp +++ clang/test/CodeGenCoroutines/coro-gro.cpp @@ -2,7 +2,7 @@ // Verify that coroutine promise and allocated memory are freed up on exception. // RUN: %clang_cc1 -std=c++1z -fcoroutines-ts -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -disable-llvm-passes | FileCheck %s -namespace std::experimental { +namespace std { template struct coroutine_traits; template struct coroutine_handle { @@ -15,11 +15,11 @@ template coroutine_handle(coroutine_handle) noexcept; }; -} +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; @@ -28,7 +28,7 @@ operator int() noexcept; }; -template <> struct std::experimental::coroutine_traits { +template <> struct std::coroutine_traits { struct promise_type { GroType get_return_object() noexcept; suspend_always initial_suspend() noexcept; @@ -51,8 +51,8 @@ // CHECK: %[[Size:.+]] = call i64 @llvm.coro.size.i64() // CHECK: call noalias nonnull i8* @_Znwm(i64 %[[Size]]) // CHECK: store i1 false, i1* %[[GroActive]] - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJiEE12promise_typeC1Ev( - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJiEE12promise_type17get_return_objectEv( + // CHECK: call void @_ZNSt16coroutine_traitsIJiEE12promise_typeC1Ev( + // CHECK: call void @_ZNSt16coroutine_traitsIJiEE12promise_type17get_return_objectEv( // CHECK: store i1 true, i1* %[[GroActive]] Cleanup cleanup; @@ -60,12 +60,12 @@ co_return; // CHECK: call void @_Z11doSomethingv( - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJiEE12promise_type11return_voidEv( + // CHECK: call void @_ZNSt16coroutine_traitsIJiEE12promise_type11return_voidEv( // CHECK: call void @_ZN7CleanupD1Ev( // Destroy promise and free the memory. - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJiEE12promise_typeD1Ev( + // CHECK: call void @_ZNSt16coroutine_traitsIJiEE12promise_typeD1Ev( // CHECK: %[[Mem:.+]] = call i8* @llvm.coro.free( // CHECK: call void @_ZdlPv(i8* %[[Mem]]) Index: clang/test/CodeGenCoroutines/coro-lambda.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-lambda.cpp +++ clang/test/CodeGenCoroutines/coro-lambda.cpp @@ -1,7 +1,7 @@ // Verify that we synthesized the coroutine for a lambda inside of a function template. // RUN: %clang_cc1 -std=c++1z -fcoroutines-ts -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -fexceptions -fcxx-exceptions -disable-llvm-passes | FileCheck %s -namespace std::experimental { +namespace std { template struct coroutine_traits { using promise_type = typename R::promise_type; }; @@ -17,11 +17,11 @@ coroutine_handle() = default; static coroutine_handle from_address(void *) noexcept; }; -} +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; Index: clang/test/CodeGenCoroutines/coro-newpm-pipeline.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-newpm-pipeline.cpp +++ clang/test/CodeGenCoroutines/coro-newpm-pipeline.cpp @@ -16,7 +16,6 @@ // CHECK-ALL: Running pass:{{.*}}CoroCleanupPass namespace std { -namespace experimental { struct handle {}; @@ -39,7 +38,6 @@ void unhandled_exception() {} }; }; -} // namespace experimental } // namespace std void foo() { co_return; } Index: clang/test/CodeGenCoroutines/coro-params.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-params.cpp +++ clang/test/CodeGenCoroutines/coro-params.cpp @@ -4,7 +4,7 @@ // Verifies that parameter copies are used to construct the promise type, if that type has a matching constructor // RUN: %clang_cc1 -std=c++1z -fcoroutines-ts -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -disable-llvm-passes -fexceptions | FileCheck %s -namespace std::experimental { +namespace std { template struct coroutine_traits; template struct coroutine_handle { @@ -17,15 +17,15 @@ template coroutine_handle(coroutine_handle) noexcept; }; -} +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; -template struct std::experimental::coroutine_traits { +template struct std::coroutine_traits { struct promise_type { void get_return_object() noexcept; suspend_always initial_suspend() noexcept; @@ -73,9 +73,9 @@ // CHECK-NEXT: bitcast %struct.MoveAndCopy* %[[McCopy]] to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8( // CHECK-NEXT: call void @_ZN11MoveAndCopyC1EOS_(%struct.MoveAndCopy* {{[^,]*}} %[[McCopy]], %struct.MoveAndCopy* nonnull align 4 dereferenceable(4) %[[McParam]]) # - // CHECK-NEXT: bitcast %"struct.std::experimental::coroutine_traits::promise_type"* %__promise to i8* + // CHECK-NEXT: bitcast %"struct.std::coroutine_traits::promise_type"* %__promise to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8( - // CHECK-NEXT: invoke void @_ZNSt12experimental16coroutine_traitsIJvi8MoveOnly11MoveAndCopyEE12promise_typeC1Ev( + // CHECK-NEXT: invoke void @_ZNSt16coroutine_traitsIJvi8MoveOnly11MoveAndCopyEE12promise_typeC1Ev( // CHECK: call void @_ZN14suspend_always12await_resumeEv( // CHECK: %[[IntParam:.+]] = load i32, i32* %{{.*}} @@ -89,12 +89,12 @@ co_return; // Skip to final suspend: - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJvi8MoveOnly11MoveAndCopyEE12promise_type13final_suspendEv( + // CHECK: call void @_ZNSt16coroutine_traitsIJvi8MoveOnly11MoveAndCopyEE12promise_type13final_suspendEv( // CHECK: call void @_ZN14suspend_always12await_resumeEv( // Destroy promise, then parameter copies: - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJvi8MoveOnly11MoveAndCopyEE12promise_typeD1Ev(%"struct.std::experimental::coroutine_traits::promise_type"* {{[^,]*}} %__promise) - // CHECK-NEXT: bitcast %"struct.std::experimental::coroutine_traits::promise_type"* %__promise to i8* + // CHECK: call void @_ZNSt16coroutine_traitsIJvi8MoveOnly11MoveAndCopyEE12promise_typeD1Ev(%"struct.std::coroutine_traits::promise_type"* {{[^,]*}} %__promise) + // CHECK-NEXT: bitcast %"struct.std::coroutine_traits::promise_type"* %__promise to i8* // CHECK-NEXT: call void @llvm.lifetime.end.p0i8( // CHECK-NEXT: call void @_ZN11MoveAndCopyD1Ev(%struct.MoveAndCopy* {{[^,]*}} %[[McCopy]]) // CHECK-NEXT: bitcast %struct.MoveAndCopy* %[[McCopy]] to i8* @@ -124,9 +124,9 @@ // CHECK-NEXT: bitcast %struct.B* %[[y_copy]] to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8( // CHECK-NEXT: call void @_ZN1BC1EOS_(%struct.B* {{[^,]*}} %[[y_copy]], %struct.B* nonnull align 4 dereferenceable(512) %y) - // CHECK-NEXT: bitcast %"struct.std::experimental::coroutine_traits::promise_type"* %__promise to i8* + // CHECK-NEXT: bitcast %"struct.std::coroutine_traits::promise_type"* %__promise to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8( - // CHECK-NEXT: invoke void @_ZNSt12experimental16coroutine_traitsIJv1A1BS2_EE12promise_typeC1Ev( + // CHECK-NEXT: invoke void @_ZNSt16coroutine_traitsIJv1A1BS1_EE12promise_typeC1Ev( co_return; } @@ -155,8 +155,8 @@ struct promise_matching_constructor {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { promise_type(promise_matching_constructor, int, float, double) {} promise_type() = delete; @@ -173,7 +173,7 @@ // CHECK: %[[INT:.+]] = load i32, i32* %5, align 4 // CHECK: %[[FLOAT:.+]] = load float, float* %6, align 4 // CHECK: %[[DOUBLE:.+]] = load double, double* %7, align 8 - // CHECK: invoke void @_ZNSt12experimental16coroutine_traitsIJv28promise_matching_constructorifdEE12promise_typeC1ES1_ifd(%"struct.std::experimental::coroutine_traits::promise_type"* {{[^,]*}} %__promise, i32 %[[INT]], float %[[FLOAT]], double %[[DOUBLE]]) + // CHECK: invoke void @_ZNSt16coroutine_traitsIJv28promise_matching_constructorifdEE12promise_typeC1ES0_ifd(%"struct.std::coroutine_traits::promise_type"* {{[^,]*}} %__promise, i32 %[[INT]], float %[[FLOAT]], double %[[DOUBLE]]) co_return; } @@ -181,7 +181,7 @@ struct method {}; -template struct std::experimental::coroutine_traits { +template struct std::coroutine_traits { struct promise_type { promise_type(some_class&, float); method get_return_object(); @@ -198,6 +198,6 @@ // CHECK-LABEL: define{{.*}} void @_ZN10some_class39good_coroutine_calls_custom_constructorEf(%struct.some_class* method some_class::good_coroutine_calls_custom_constructor(float) { - // CHECK: invoke void @_ZNSt12experimental16coroutine_traitsIJ6methodR10some_classfEE12promise_typeC1ES3_f(%"struct.std::experimental::coroutine_traits::promise_type"* {{[^,]*}} %__promise, %struct.some_class* nonnull align 1 dereferenceable(1) %{{.+}}, float + // CHECK: invoke void @_ZNSt16coroutine_traitsIJ6methodR10some_classfEE12promise_typeC1ES2_f(%"struct.std::coroutine_traits::promise_type"* {{[^,]*}} %__promise, %struct.some_class* nonnull align 1 dereferenceable(1) %{{.+}}, float co_return; } Index: clang/test/CodeGenCoroutines/coro-promise-dtor.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-promise-dtor.cpp +++ clang/test/CodeGenCoroutines/coro-promise-dtor.cpp @@ -3,15 +3,13 @@ #include "Inputs/coroutine.h" -namespace coro = std::experimental::coroutines_v1; - struct coro_t { void* p; ~coro_t(); struct promise_type { coro_t get_return_object(); - coro::suspend_never initial_suspend(); - coro::suspend_never final_suspend() noexcept; + std::suspend_never initial_suspend(); + std::suspend_never final_suspend() noexcept; void return_void(); promise_type(); ~promise_type(); Index: clang/test/CodeGenCoroutines/coro-ret-void.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-ret-void.cpp +++ clang/test/CodeGenCoroutines/coro-ret-void.cpp @@ -2,23 +2,21 @@ #include "Inputs/coroutine.h" -namespace coro = std::experimental::coroutines_v1; - struct coro1 { struct promise_type { coro1 get_return_object(); - coro::suspend_never initial_suspend(); - coro::suspend_never final_suspend() noexcept; + std::suspend_never initial_suspend(); + std::suspend_never final_suspend() noexcept; void return_void(); }; }; coro1 f() { - co_await coro::suspend_never{}; + co_await std::suspend_never{}; } // CHECK-LABEL: define{{.*}} void @_Z1fv( -// CHECK: call void @_ZNSt12experimental13coroutines_v113suspend_never12await_resumeEv(%"struct.std::experimental::coroutines_v1::suspend_never"* +// CHECK: call void @_ZNSt13suspend_never12await_resumeEv(%"struct.std::suspend_never"* // CHECK: call void @_ZN5coro112promise_type11return_voidEv(%"struct.coro1::promise_type"* {{[^,]*}} %__promise) struct A { @@ -38,8 +36,8 @@ struct coro2 { struct promise_type { coro2 get_return_object(); - coro::suspend_never initial_suspend(); - coro::suspend_never final_suspend() noexcept; + std::suspend_never initial_suspend(); + std::suspend_never final_suspend() noexcept; void return_value(int); }; }; @@ -49,5 +47,5 @@ } // CHECK-LABEL: define{{.*}} void @_Z1gv( -// CHECK: call void @_ZNSt12experimental13coroutines_v113suspend_never12await_resumeEv(%"struct.std::experimental::coroutines_v1::suspend_never"* +// CHECK: call void @_ZNSt13suspend_never12await_resumeEv(%"struct.std::suspend_never"* // CHECK: call void @_ZN5coro212promise_type12return_valueEi(%"struct.coro2::promise_type"* {{[^,]*}} %__promise, i32 42) Index: clang/test/CodeGenCoroutines/coro-return-voidtype-initlist.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-return-voidtype-initlist.cpp +++ clang/test/CodeGenCoroutines/coro-return-voidtype-initlist.cpp @@ -5,7 +5,6 @@ struct b { b(int, a); }; template struct c {}; -namespace experimental { template struct coroutine_traits : d {}; template @@ -21,7 +20,6 @@ void await_suspend(coroutine_handle<>); void await_resume(); }; -} // namespace experimental } // namespace std template auto ah(ag) { return ag().ah(0); } @@ -31,10 +29,10 @@ struct h { int await_ready() noexcept; template - void await_suspend(std::experimental::coroutine_handle) noexcept; + void await_suspend(std::coroutine_handle) noexcept; void await_resume() noexcept; }; - std::experimental::e initial_suspend(); + std::e initial_suspend(); h final_suspend() noexcept; template auto await_transform(ag) { return ah(ag()); } @@ -45,20 +43,20 @@ void unhandled_exception(); }; struct k { - k(std::experimental::coroutine_handle<>); + k(std::coroutine_handle<>); int await_ready(); }; template struct f { using promise_type = j; - std::experimental::coroutine_handle<> ar; + std::coroutine_handle<> ar; struct l : k { using at = k; - l(std::experimental::coroutine_handle<> m) : at(m) {} - void await_suspend(std::experimental::coroutine_handle<>); + l(std::coroutine_handle<> m) : at(m) {} + void await_suspend(std::coroutine_handle<>); }; struct n : l { - n(std::experimental::coroutine_handle<> m) : l(m) {} + n(std::coroutine_handle<> m) : l(m) {} am await_resume(); }; auto ah(int) { return n(ar); } Index: clang/test/CodeGenCoroutines/coro-return.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-return.cpp +++ clang/test/CodeGenCoroutines/coro-return.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcoroutines-ts -std=c++1z -emit-llvm %s -o - -disable-llvm-passes | FileCheck %s -namespace std::experimental { +namespace std { template struct coroutine_traits; template struct coroutine_handle { @@ -13,15 +13,15 @@ template coroutine_handle(coroutine_handle) noexcept {} }; -} +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; -template <> struct std::experimental::coroutine_traits { +template <> struct std::coroutine_traits { struct promise_type { void get_return_object(); suspend_always initial_suspend(); @@ -32,15 +32,15 @@ // CHECK-LABEL: f0( extern "C" void f0() { - // CHECK: %__promise = alloca %"struct.std::experimental::coroutine_traits::promise_type" + // CHECK: %__promise = alloca %"struct.std::coroutine_traits::promise_type" // CHECK: %call = call noalias nonnull i8* @_Znwm( - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJvEE12promise_type11return_voidEv(%"struct.std::experimental::coroutine_traits::promise_type"* {{[^,]*}} %__promise) + // CHECK: call void @_ZNSt16coroutine_traitsIJvEE12promise_type11return_voidEv(%"struct.std::coroutine_traits::promise_type"* {{[^,]*}} %__promise) // CHECK: call void @_ZdlPv co_return; } -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { int get_return_object(); suspend_always initial_suspend(); @@ -51,9 +51,9 @@ // CHECK-LABEL: f1( extern "C" int f1() { - // CHECK: %__promise = alloca %"struct.std::experimental::coroutine_traits::promise_type" + // CHECK: %__promise = alloca %"struct.std::coroutine_traits::promise_type" // CHECK: %call = call noalias nonnull i8* @_Znwm( - // CHECK: call void @_ZNSt12experimental16coroutine_traitsIJiEE12promise_type12return_valueEi(%"struct.std::experimental::coroutine_traits::promise_type"* {{[^,]*}} %__promise, i32 42) + // CHECK: call void @_ZNSt16coroutine_traitsIJiEE12promise_type12return_valueEi(%"struct.std::coroutine_traits::promise_type"* {{[^,]*}} %__promise, i32 42) // CHECK: call void @_ZdlPv co_return 42; } Index: clang/test/CodeGenCoroutines/coro-symmetric-transfer-01.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-symmetric-transfer-01.cpp +++ clang/test/CodeGenCoroutines/coro-symmetric-transfer-01.cpp @@ -3,19 +3,17 @@ #include "Inputs/coroutine.h" -namespace coro = std::experimental::coroutines_v1; - struct detached_task { struct promise_type { detached_task get_return_object() noexcept { - return detached_task{coro::coroutine_handle::from_promise(*this)}; + return detached_task{std::coroutine_handle::from_promise(*this)}; } void return_void() noexcept {} struct final_awaiter { bool await_ready() noexcept { return false; } - coro::coroutine_handle<> await_suspend(coro::coroutine_handle h) noexcept { + std::coroutine_handle<> await_suspend(std::coroutine_handle h) noexcept { h.destroy(); return {}; } @@ -26,7 +24,7 @@ final_awaiter final_suspend() noexcept { return {}; } - coro::suspend_always initial_suspend() noexcept { return {}; } + std::suspend_always initial_suspend() noexcept { return {}; } }; ~detached_task() { @@ -42,7 +40,7 @@ tmp.resume(); } - coro::coroutine_handle coro_; + std::coroutine_handle coro_; }; detached_task foo() { @@ -52,12 +50,12 @@ // check that the lifetime of the coroutine handle used to obtain the address is contained within single basic block, and hence does not live across suspension points. // CHECK-LABEL: final.suspend: // CHECK: %{{.+}} = call token @llvm.coro.save(i8* null) -// CHECK: %[[HDL_CAST1:.+]] = bitcast %"struct.std::experimental::coroutines_v1::coroutine_handle.0"* %[[HDL:.+]] to i8* +// CHECK: %[[HDL_CAST1:.+]] = bitcast %"struct.std::coroutine_handle.0"* %[[HDL:.+]] to i8* // CHECK: call void @llvm.lifetime.start.p0i8(i64 8, i8* %[[HDL_CAST1]]) -// CHECK: %[[CALL:.+]] = call i8* @_ZN13detached_task12promise_type13final_awaiter13await_suspendENSt12experimental13coroutines_v116coroutine_handleIS0_EE( -// CHECK: %[[HDL_CAST2:.+]] = getelementptr inbounds %"struct.std::experimental::coroutines_v1::coroutine_handle.0", %"struct.std::experimental::coroutines_v1::coroutine_handle.0"* %[[HDL]], i32 0, i32 0 +// CHECK: %[[CALL:.+]] = call i8* @_ZN13detached_task12promise_type13final_awaiter13await_suspendESt16coroutine_handleIS0_E( +// CHECK: %[[HDL_CAST2:.+]] = getelementptr inbounds %"struct.std::coroutine_handle.0", %"struct.std::coroutine_handle.0"* %[[HDL]], i32 0, i32 0 // CHECK: store i8* %[[CALL]], i8** %[[HDL_CAST2]], align 8 -// CHECK: %[[HDL_TRANSFER:.+]] = call i8* @_ZNKSt12experimental13coroutines_v116coroutine_handleIvE7addressEv(%"struct.std::experimental::coroutines_v1::coroutine_handle.0"* nonnull align 8 dereferenceable(8) %[[HDL]]) -// CHECK: %[[HDL_CAST3:.+]] = bitcast %"struct.std::experimental::coroutines_v1::coroutine_handle.0"* %[[HDL]] to i8* +// CHECK: %[[HDL_TRANSFER:.+]] = call i8* @_ZNKSt16coroutine_handleIvE7addressEv(%"struct.std::coroutine_handle.0"* nonnull align 8 dereferenceable(8) %[[HDL]]) +// CHECK: %[[HDL_CAST3:.+]] = bitcast %"struct.std::coroutine_handle.0"* %[[HDL]] to i8* // CHECK: call void @llvm.lifetime.end.p0i8(i64 8, i8* %[[HDL_CAST3]]) // CHECK: call void @llvm.coro.resume(i8* %[[HDL_TRANSFER]]) Index: clang/test/CodeGenCoroutines/coro-symmetric-transfer-02.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-symmetric-transfer-02.cpp +++ clang/test/CodeGenCoroutines/coro-symmetric-transfer-02.cpp @@ -2,19 +2,17 @@ #include "Inputs/coroutine.h" -namespace coro = std::experimental::coroutines_v1; - struct Task { struct promise_type { Task get_return_object() noexcept { - return Task{coro::coroutine_handle::from_promise(*this)}; + return Task{std::coroutine_handle::from_promise(*this)}; } void return_void() noexcept {} struct final_awaiter { bool await_ready() noexcept { return false; } - coro::coroutine_handle<> await_suspend(coro::coroutine_handle h) noexcept { + std::coroutine_handle<> await_suspend(std::coroutine_handle h) noexcept { h.destroy(); return {}; } @@ -25,7 +23,7 @@ final_awaiter final_suspend() noexcept { return {}; } - coro::suspend_always initial_suspend() noexcept { return {}; } + std::suspend_always initial_suspend() noexcept { return {}; } template auto await_transform(Awaitable &&awaitable) { @@ -33,7 +31,7 @@ } }; - using handle_t = coro::coroutine_handle; + using handle_t = std::coroutine_handle; class Awaiter { public: @@ -43,7 +41,7 @@ ~Awaiter(); bool await_ready() noexcept { return false; } - handle_t await_suspend(coro::coroutine_handle<> continuation) noexcept; + handle_t await_suspend(std::coroutine_handle<> continuation) noexcept; void await_resume(); private: @@ -91,10 +89,10 @@ // CHECK: br i1 %{{.+}}, label %[[CASE1_AWAIT_READY:.+]], label %[[CASE1_AWAIT_SUSPEND:.+]] // CHECK: [[CASE1_AWAIT_SUSPEND]]: // CHECK-NEXT: %{{.+}} = call token @llvm.coro.save(i8* null) -// CHECK-NEXT: %[[HANDLE11:.+]] = bitcast %"struct.std::experimental::coroutines_v1::coroutine_handle"* %[[TMP1:.+]] to i8* +// CHECK-NEXT: %[[HANDLE11:.+]] = bitcast %"struct.std::coroutine_handle"* %[[TMP1:.+]] to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* %[[HANDLE11]]) -// CHECK: %[[HANDLE12:.+]] = bitcast %"struct.std::experimental::coroutines_v1::coroutine_handle"* %[[TMP1]] to i8* +// CHECK: %[[HANDLE12:.+]] = bitcast %"struct.std::coroutine_handle"* %[[TMP1]] to i8* // CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 8, i8* %[[HANDLE12]]) // CHECK-NEXT: call void @llvm.coro.resume // CHECK-NEXT: %{{.+}} = call i8 @llvm.coro.suspend @@ -110,10 +108,10 @@ // CHECK: br i1 %{{.+}}, label %[[CASE2_AWAIT_READY:.+]], label %[[CASE2_AWAIT_SUSPEND:.+]] // CHECK: [[CASE2_AWAIT_SUSPEND]]: // CHECK-NEXT: %{{.+}} = call token @llvm.coro.save(i8* null) -// CHECK-NEXT: %[[HANDLE21:.+]] = bitcast %"struct.std::experimental::coroutines_v1::coroutine_handle"* %[[TMP2:.+]] to i8* +// CHECK-NEXT: %[[HANDLE21:.+]] = bitcast %"struct.std::coroutine_handle"* %[[TMP2:.+]] to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* %[[HANDLE21]]) -// CHECK: %[[HANDLE22:.+]] = bitcast %"struct.std::experimental::coroutines_v1::coroutine_handle"* %[[TMP2]] to i8* +// CHECK: %[[HANDLE22:.+]] = bitcast %"struct.std::coroutine_handle"* %[[TMP2]] to i8* // CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 8, i8* %[[HANDLE22]]) // CHECK-NEXT: call void @llvm.coro.resume // CHECK-NEXT: %{{.+}} = call i8 @llvm.coro.suspend Index: clang/test/CodeGenCoroutines/coro-unhandled-exception.cpp =================================================================== --- clang/test/CodeGenCoroutines/coro-unhandled-exception.cpp +++ clang/test/CodeGenCoroutines/coro-unhandled-exception.cpp @@ -3,8 +3,6 @@ #include "Inputs/coroutine.h" -namespace coro = std::experimental::coroutines_v1; - namespace std { using exception_ptr = int; exception_ptr current_exception(); @@ -13,11 +11,11 @@ struct coro_t { struct promise_type { coro_t get_return_object() { - coro::coroutine_handle{}; + std::coroutine_handle{}; return {}; } - coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() noexcept { return {}; } + std::suspend_never initial_suspend() { return {}; } + std::suspend_never final_suspend() noexcept { return {}; } void return_void(){} void unhandled_exception() noexcept; }; @@ -50,9 +48,9 @@ // CHECK: [[TRYCONT]]: // CHECK-NEXT: br label %[[COROFIN:.+]] // CHECK: [[COROFIN]]: -// CHECK-NEXT: bitcast %"struct.std::experimental::coroutines_v1::suspend_never"* %{{.+}} to i8* +// CHECK-NEXT: bitcast %"struct.std::suspend_never"* %{{.+}} to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8( -// CHECK-NEXT: call void @"?final_suspend@promise_type@coro_t@@QEAA?AUsuspend_never@coroutines_v1@experimental@std@@XZ"( +// CHECK-NEXT: call void @"?final_suspend@promise_type@coro_t@@QEAA?AUsuspend_never@std@@XZ"( // CHECK-LPAD: @_Z1fv( // CHECK-LPAD: invoke void @_Z9may_throwv() @@ -71,6 +69,6 @@ // CHECK-LPAD: [[TRYCONT]]: // CHECK-LPAD: br label %[[COROFIN:.+]] // CHECK-LPAD: [[COROFIN]]: -// CHECK-LPAD-NEXT: bitcast %"struct.std::experimental::coroutines_v1::suspend_never"* %{{.+}} to i8* +// CHECK-LPAD-NEXT: bitcast %"struct.std::suspend_never"* %{{.+}} to i8* // CHECK-LPAD-NEXT: call void @llvm.lifetime.start.p0i8( // CHECK-LPAD-NEXT: call void @_ZN6coro_t12promise_type13final_suspendEv( Index: clang/test/CoverageMapping/coroutine.cpp =================================================================== --- clang/test/CoverageMapping/coroutine.cpp +++ clang/test/CoverageMapping/coroutine.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -triple x86_64-unknown-linux-gnu -fcoroutines-ts -std=c++14 -emit-llvm -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping %s -o - | FileCheck %s -namespace std::experimental { +namespace std { template struct coroutine_traits; @@ -16,16 +16,16 @@ template coroutine_handle(coroutine_handle) noexcept {} }; -} // namespace std::experimental +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; template <> -struct std::experimental::coroutine_traits { +struct std::coroutine_traits { struct promise_type { int get_return_object(); suspend_always initial_suspend(); Index: clang/test/Index/coroutines.cpp =================================================================== --- clang/test/Index/coroutines.cpp +++ clang/test/Index/coroutines.cpp @@ -1,8 +1,8 @@ // RUN: c-index-test -test-load-source all -c %s -fsyntax-only -target x86_64-apple-darwin9 -fcoroutines-ts -std=c++1z -I%S/../SemaCXX/Inputs | FileCheck %s #include "std-coroutine.h" -using std::experimental::suspend_always; -using std::experimental::suspend_never; +using std::suspend_always; +using std::suspend_never; struct promise_void { void get_return_object(); @@ -13,7 +13,7 @@ }; template <> -struct std::experimental::coroutine_traits { using promise_type = promise_void; }; +struct std::coroutine_traits { using promise_type = promise_void; }; void CoroutineTestRet() { co_return; Index: clang/test/PCH/coroutines.cpp =================================================================== --- clang/test/PCH/coroutines.cpp +++ clang/test/PCH/coroutines.cpp @@ -8,7 +8,7 @@ #ifndef HEADER #define HEADER -namespace std::experimental { +namespace std { template struct coroutine_traits; template struct coroutine_handle { @@ -21,15 +21,15 @@ template coroutine_handle(coroutine_handle) noexcept; }; -} +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; -template struct std::experimental::coroutine_traits { +template struct std::coroutine_traits { struct promise_type { void get_return_object() noexcept; suspend_always initial_suspend() noexcept; @@ -42,7 +42,7 @@ }; }; -template struct std::experimental::coroutine_traits { +template struct std::coroutine_traits { struct promise_type { int get_return_object() noexcept; suspend_always initial_suspend() noexcept; Index: clang/test/SemaCXX/Inputs/std-coroutine.h =================================================================== --- clang/test/SemaCXX/Inputs/std-coroutine.h +++ clang/test/SemaCXX/Inputs/std-coroutine.h @@ -3,7 +3,6 @@ #define STD_COROUTINE_H namespace std { -namespace experimental { template struct coroutine_traits { using promise_type = typename Ret::promise_type; }; @@ -31,7 +30,6 @@ void await_resume() noexcept {} }; -} // namespace experimental } // namespace std #endif // STD_COROUTINE_H Index: clang/test/SemaCXX/co_await-range-for.cpp =================================================================== --- clang/test/SemaCXX/co_await-range-for.cpp +++ clang/test/SemaCXX/co_await-range-for.cpp @@ -3,8 +3,7 @@ // RUN: -fblocks #include "Inputs/std-coroutine.h" -using namespace std::experimental; - +using namespace std; template struct Awaiter { Index: clang/test/SemaCXX/coreturn-eh.cpp =================================================================== --- clang/test/SemaCXX/coreturn-eh.cpp +++ clang/test/SemaCXX/coreturn-eh.cpp @@ -3,12 +3,12 @@ #include "Inputs/std-coroutine.h" -using std::experimental::suspend_always; -using std::experimental::suspend_never; +using std::suspend_always; +using std::suspend_never; struct awaitable { bool await_ready(); - void await_suspend(std::experimental::coroutine_handle<>); // FIXME: coroutine_handle + void await_suspend(std::coroutine_handle<>); // FIXME: coroutine_handle void await_resume(); } a; @@ -33,7 +33,7 @@ }; template -struct std::experimental::coroutine_traits { using promise_type = promise_void_return_value; }; +struct std::coroutine_traits { using promise_type = promise_void_return_value; }; VoidTagReturnValue test() { object x = {}; Index: clang/test/SemaCXX/coreturn.cpp =================================================================== --- clang/test/SemaCXX/coreturn.cpp +++ clang/test/SemaCXX/coreturn.cpp @@ -1,12 +1,12 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wall -Wextra -Wno-error=unreachable-code #include "Inputs/std-coroutine.h" -using std::experimental::suspend_always; -using std::experimental::suspend_never; +using std::suspend_always; +using std::suspend_never; struct awaitable { bool await_ready(); - void await_suspend(std::experimental::coroutine_handle<>); // FIXME: coroutine_handle + void await_suspend(std::coroutine_handle<>); // FIXME: coroutine_handle void await_resume(); } a; @@ -72,16 +72,16 @@ }; template <> -struct std::experimental::coroutine_traits { using promise_type = promise_void; }; +struct std::coroutine_traits { using promise_type = promise_void; }; template -struct std::experimental::coroutine_traits { using promise_type = promise_void_return_value; }; +struct std::coroutine_traits { using promise_type = promise_void_return_value; }; template -struct std::experimental::coroutine_traits { using promise_type = promise_float; }; +struct std::coroutine_traits { using promise_type = promise_float; }; template -struct std::experimental::coroutine_traits { using promise_type = promise_int; }; +struct std::coroutine_traits { using promise_type = promise_int; }; void test0() { co_await a; } float test1() { co_await a; } Index: clang/test/SemaCXX/coroutine-final-suspend-noexcept.cpp =================================================================== --- clang/test/SemaCXX/coroutine-final-suspend-noexcept.cpp +++ clang/test/SemaCXX/coroutine-final-suspend-noexcept.cpp @@ -4,7 +4,6 @@ // RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -verify %s -fcxx-exceptions -fexceptions -Wunused-result namespace std { -namespace experimental { template struct coroutine_traits { using promise_type = typename Ret::promise_type; }; @@ -34,10 +33,9 @@ ~suspend_always() noexcept(false); // expected-note 2 {{must be declared with 'noexcept'}} }; -} // namespace experimental } // namespace std -using namespace std::experimental; +using namespace std; struct A { bool await_ready(); Index: clang/test/SemaCXX/coroutine-rvo.cpp =================================================================== --- clang/test/SemaCXX/coroutine-rvo.cpp +++ clang/test/SemaCXX/coroutine-rvo.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -verify -std=c++17 -fcoroutines-ts -fsyntax-only %s -namespace std::experimental { +namespace std { template struct coroutine_handle { coroutine_handle() = default; static coroutine_handle from_address(void *) noexcept; @@ -30,11 +30,11 @@ template struct coroutine_traits : public traits_sfinae_base {}; -} +} // namespace std struct suspend_never { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; Index: clang/test/SemaCXX/coroutine-seh.cpp =================================================================== --- clang/test/SemaCXX/coroutine-seh.cpp +++ clang/test/SemaCXX/coroutine-seh.cpp @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -std=c++1z -fcoroutines-ts -verify %s -fcxx-exceptions -fexceptions -triple x86_64-windows-msvc -fms-extensions -namespace std::experimental { +namespace std { template struct coroutine_traits; template struct coroutine_handle { @@ -12,15 +12,15 @@ template coroutine_handle(coroutine_handle) noexcept; }; -} +} // namespace std struct suspend_always { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; -template <> struct std::experimental::coroutine_traits { +template <> struct std::coroutine_traits { struct promise_type { void get_return_object() noexcept; suspend_always initial_suspend() noexcept; Index: clang/test/SemaCXX/coroutine-traits-undefined-template.cpp =================================================================== --- clang/test/SemaCXX/coroutine-traits-undefined-template.cpp +++ clang/test/SemaCXX/coroutine-traits-undefined-template.cpp @@ -4,15 +4,14 @@ // RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -verify %s -fcxx-exceptions -fexceptions -Wunused-result namespace std { -namespace experimental { template struct coroutine_traits { struct promise_type {}; }; -template<> struct coroutine_traits; // expected-note {{forward declaration of 'std::experimental::coroutine_traits'}} -}} // namespace std::experimental +template <> struct coroutine_traits; // expected-note {{forward declaration of 'std::coroutine_traits'}} +} // namespace std void uses_forward_declaration() { co_return; // expected-error {{this function cannot be a coroutine: missing definition of specialization 'coroutine_traits'}} Index: clang/test/SemaCXX/coroutine-unhandled_exception-warning.cpp =================================================================== --- clang/test/SemaCXX/coroutine-unhandled_exception-warning.cpp +++ clang/test/SemaCXX/coroutine-unhandled_exception-warning.cpp @@ -13,8 +13,8 @@ #include "Inputs/std-coroutine.h" -using std::experimental::suspend_always; -using std::experimental::suspend_never; +using std::suspend_always; +using std::suspend_never; #ifndef DISABLE_WARNING struct promise_void { // expected-note {{defined here}} @@ -28,7 +28,7 @@ }; template -struct std::experimental::coroutine_traits { using promise_type = promise_void; }; +struct std::coroutine_traits { using promise_type = promise_void; }; #ifndef DISABLE_WARNING void test0() { // expected-warning {{'promise_void' is required to declare the member 'unhandled_exception()' when exceptions are enabled}} Index: clang/test/SemaCXX/coroutine-uninitialized-warning-crash.cpp =================================================================== --- clang/test/SemaCXX/coroutine-uninitialized-warning-crash.cpp +++ clang/test/SemaCXX/coroutine-uninitialized-warning-crash.cpp @@ -1,8 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts -fsyntax-only -Wall -Wextra -Wuninitialized -fblocks #include "Inputs/std-coroutine.h" -using namespace std::experimental; - +using namespace std; struct A { bool await_ready() { return true; } Index: clang/test/SemaCXX/coroutine_handle-addres-return-type.cpp =================================================================== --- clang/test/SemaCXX/coroutine_handle-addres-return-type.cpp +++ clang/test/SemaCXX/coroutine_handle-addres-return-type.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -verify %s -stdlib=libc++ -std=c++1z -fcoroutines-ts -fsyntax-only -namespace std::experimental { +namespace std { template struct coroutine_handle; @@ -32,11 +32,11 @@ template struct coroutine_traits : public traits_sfinae_base {}; -} // namespace std::experimental +} // namespace std struct suspend_never { bool await_ready() noexcept; - void await_suspend(std::experimental::coroutine_handle<>) noexcept; + void await_suspend(std::coroutine_handle<>) noexcept; void await_resume() noexcept; }; @@ -50,18 +50,18 @@ }; }; -namespace std::experimental { +namespace std { template <> struct coroutine_handle : public coroutine_handle<> { coroutine_handle *address() const; // expected-warning {{return type of 'coroutine_handle<>::address should be 'void*'}} }; -} // namespace std::experimental +} // namespace std struct awaitable { bool await_ready(); - std::experimental::coroutine_handle - await_suspend(std::experimental::coroutine_handle<> handle); + std::coroutine_handle + await_suspend(std::coroutine_handle<> handle); void await_resume(); } a; Index: clang/test/SemaCXX/coroutines.cpp =================================================================== --- clang/test/SemaCXX/coroutines.cpp +++ clang/test/SemaCXX/coroutines.cpp @@ -6,27 +6,26 @@ // RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -fsyntax-only -verify=expected,cxx14_20 %s -fcxx-exceptions -fexceptions -Wunused-result void no_coroutine_traits_bad_arg_await() { - co_await a; // expected-error {{include }} + co_await a; // expected-error {{include }} // expected-error@-1 {{use of undeclared identifier 'a'}} } void no_coroutine_traits_bad_arg_yield() { - co_yield a; // expected-error {{include }} + co_yield a; // expected-error {{include }} // expected-error@-1 {{use of undeclared identifier 'a'}} } void no_coroutine_traits_bad_arg_return() { - co_return a; // expected-error {{include }} + co_return a; // expected-error {{include }} // expected-error@-1 {{use of undeclared identifier 'a'}} } void no_coroutine_traits() { - co_await 4; // expected-error {{std::experimental::coroutine_traits type was not found; include }} + co_await 4; // expected-error {{std::coroutine_traits type was not found; include }} } namespace std { -namespace experimental { template struct void_t_imp { @@ -45,11 +44,11 @@ template struct coroutine_traits : public traits_sfinae_base {}; -}} // namespace std::experimental +} // end of namespace std template struct coro {}; template -struct std::experimental::coroutine_traits, Ps...> { +struct std::coroutine_traits, Ps...> { using promise_type = Promise; }; @@ -81,47 +80,46 @@ }; struct DummyVoidTag {}; -DummyVoidTag no_specialization() { // expected-error {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} +DummyVoidTag no_specialization() { // expected-error {{this function cannot be a coroutine: 'std::coroutine_traits' has no member named 'promise_type'}} co_await a; } template -struct std::experimental::coroutine_traits {}; +struct std::coroutine_traits {}; -int no_promise_type() { // expected-error {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} +int no_promise_type() { // expected-error {{this function cannot be a coroutine: 'std::coroutine_traits' has no member named 'promise_type'}} co_await a; } -int no_promise_type_multiple_awaits(int) { // expected-error {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} +int no_promise_type_multiple_awaits(int) { // expected-error {{this function cannot be a coroutine: 'std::coroutine_traits' has no member named 'promise_type'}} co_await a; co_await a; } template <> -struct std::experimental::coroutine_traits { typedef int promise_type; }; -double bad_promise_type(double) { // expected-error {{this function cannot be a coroutine: 'experimental::coroutine_traits::promise_type' (aka 'int') is not a class}} +struct std::coroutine_traits { typedef int promise_type; }; +double bad_promise_type(double) { // expected-error {{this function cannot be a coroutine: 'std::coroutine_traits::promise_type' (aka 'int') is not a class}} co_await a; } template <> -struct std::experimental::coroutine_traits { +struct std::coroutine_traits { struct promise_type {}; }; double bad_promise_type_2(int) { // expected-error {{no member named 'initial_suspend'}} - co_yield 0; // expected-error {{no member named 'yield_value' in 'std::experimental::coroutine_traits::promise_type'}} + co_yield 0; // expected-error {{no member named 'yield_value' in 'std::coroutine_traits::promise_type'}} } struct promise; // expected-note {{forward declaration}} struct promise_void; struct void_tag {}; template -struct std::experimental::coroutine_traits { using promise_type = promise; }; +struct std::coroutine_traits { using promise_type = promise; }; template -struct std::experimental::coroutine_traits -{ using promise_type = promise_void; }; +struct std::coroutine_traits { using promise_type = promise_void; }; // FIXME: This diagnostic is terrible. -void undefined_promise() { // expected-error {{this function cannot be a coroutine: 'experimental::coroutine_traits::promise_type' (aka 'promise') is an incomplete type}} +void undefined_promise() { // expected-error {{this function cannot be a coroutine: 'std::coroutine_traits::promise_type' (aka 'promise') is an incomplete type}} co_await a; } @@ -148,13 +146,12 @@ void unhandled_exception(); }; -void no_coroutine_handle() { // expected-error {{std::experimental::coroutine_handle type was not found; include before defining a coroutine}} +void no_coroutine_handle() { // expected-error {{std::coroutine_handle type was not found; include before defining a coroutine}} //expected-note@-1 {{call to 'initial_suspend' implicitly required by the initial suspend point}} co_return 5; //expected-note {{function is a coroutine due to use of 'co_return' here}} } namespace std { -namespace experimental { template struct coroutine_handle { static coroutine_handle from_address(void *) noexcept; @@ -165,7 +162,7 @@ coroutine_handle(coroutine_handle) noexcept; static coroutine_handle from_address(void *) noexcept; }; -}} // namespace std::experimental +} // namespace std void yield() { co_yield 0; @@ -529,7 +526,7 @@ struct yield_fn_tag {}; template <> -struct std::experimental::coroutine_traits { +struct std::coroutine_traits { struct promise_type { // FIXME: add an await_transform overload for functions awaitable yield_value(int()); @@ -747,8 +744,7 @@ } template void ok_generic_lambda_coawait_PR41909(); // expected-note {{in instantiation of function template specialization 'ok_generic_lambda_coawait_PR41909' requested here}} -template<> struct std::experimental::coroutine_traits -{ using promise_type = promise; }; +template <> struct std::coroutine_traits { using promise_type = promise; }; int main(int, const char**) { co_await a; // expected-error {{'co_await' cannot be used in the 'main' function}} @@ -761,12 +757,11 @@ void return_void(); void unhandled_exception(); }; -template<> struct std::experimental::coroutine_handle {}; +template <> struct std::coroutine_handle {}; -template<> struct std::experimental::coroutine_traits -{ using promise_type = good_promise_2; }; +template <> struct std::coroutine_traits { using promise_type = good_promise_2; }; -float badly_specialized_coro_handle() { // expected-error {{std::experimental::coroutine_handle missing a member named 'from_address'}} +float badly_specialized_coro_handle() { // expected-error {{std::coroutine_handle missing a member named 'from_address'}} //expected-note@-1 {{call to 'initial_suspend' implicitly required by the initial suspend point}} co_return; //expected-note {{function is a coroutine due to use of 'co_return' here}} } @@ -785,8 +780,8 @@ struct promise_on_alloc_failure_tag {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { int get_return_object() {} suspend_always initial_suspend() { return {}; } @@ -905,8 +900,8 @@ } struct mismatch_gro_type_tag1 {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void get_return_object() {} //expected-note {{member 'get_return_object' declared here}} suspend_always initial_suspend() { return {}; } @@ -922,8 +917,8 @@ } struct mismatch_gro_type_tag2 {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { void *get_return_object() {} //expected-note {{member 'get_return_object' declared here}} suspend_always initial_suspend() { return {}; } @@ -940,8 +935,8 @@ } struct mismatch_gro_type_tag3 {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { int get_return_object() {} static void get_return_object_on_allocation_failure() {} //expected-note {{member 'get_return_object_on_allocation_failure' declared here}} @@ -959,8 +954,8 @@ struct mismatch_gro_type_tag4 {}; -template<> -struct std::experimental::coroutine_traits { +template <> +struct std::coroutine_traits { struct promise_type { int get_return_object() {} static char *get_return_object_on_allocation_failure() {} //expected-note {{member 'get_return_object_on_allocation_failure' declared}} @@ -992,13 +987,13 @@ struct bad_await_suspend_return { bool await_ready(); // expected-error@+1 {{return type of 'await_suspend' is required to be 'void' or 'bool' (have 'char')}} - char await_suspend(std::experimental::coroutine_handle<>); + char await_suspend(std::coroutine_handle<>); void await_resume(); }; struct bad_await_ready_return { // expected-note@+1 {{return type of 'await_ready' is required to be contextually convertible to 'bool'}} void await_ready(); - bool await_suspend(std::experimental::coroutine_handle<>); + bool await_suspend(std::coroutine_handle<>); void await_resume(); }; struct await_ready_explicit_bool { @@ -1006,7 +1001,7 @@ explicit operator bool() const; }; BoolT await_ready(); - void await_suspend(std::experimental::coroutine_handle<>); + void await_suspend(std::coroutine_handle<>); void await_resume(); }; template @@ -1014,7 +1009,7 @@ bool await_ready(); // expected-error@+2 {{return type of 'await_suspend' is required to be 'void' or 'bool' (have 'bool &')}} // expected-error@+1 {{return type of 'await_suspend' is required to be 'void' or 'bool' (have 'bool &&')}} - SuspendTy await_suspend(std::experimental::coroutine_handle<>); + SuspendTy await_suspend(std::coroutine_handle<>); // cxx20_2b-warning@-1 {{volatile-qualified return type 'const volatile bool' is deprecated}} void await_resume(); }; @@ -1074,7 +1069,7 @@ template static constexpr bool MatchesArgs = IsSameV>; + std::coroutine_traits>; }; template @@ -1086,7 +1081,7 @@ template struct CoroMemberPromise { - using TraitsT = std::experimental::coroutine_traits; + using TraitsT = std::coroutine_traits; using TypeTestT = TypeTest; using AwaitTestT = AwaitReturnsType; @@ -1103,7 +1098,7 @@ } // namespace CoroHandleMemberFunctionTest template -struct ::std::experimental::coroutine_traits { +struct ::std::coroutine_traits { using promise_type = CoroHandleMemberFunctionTest::CoroMemberPromise; }; @@ -1189,16 +1184,16 @@ } BadCoroMemberTag test_diagnostics() { - // expected-error@-1 {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} + // expected-error@-1 {{this function cannot be a coroutine: 'std::coroutine_traits' has no member named 'promise_type'}} co_return; } BadCoroMemberTag test_diagnostics(int) const && { - // expected-error@-1 {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} + // expected-error@-1 {{this function cannot be a coroutine: 'std::coroutine_traits' has no member named 'promise_type'}} co_return; } static BadCoroMemberTag test_static_diagnostics(long *) { - // expected-error@-1 {{this function cannot be a coroutine: 'std::experimental::coroutine_traits' has no member named 'promise_type'}} + // expected-error@-1 {{this function cannot be a coroutine: 'std::coroutine_traits' has no member named 'promise_type'}} co_return; } }; @@ -1310,7 +1305,7 @@ coro bad_coroutine_calls_deleted_promise_constructor() { - // expected-error@-1 {{call to deleted constructor of 'std::experimental::coroutine_traits>::promise_type' (aka 'CoroHandleMemberFunctionTest::bad_promise_deleted_constructor')}} + // expected-error@-1 {{call to deleted constructor of 'std::coroutine_traits>::promise_type' (aka 'CoroHandleMemberFunctionTest::bad_promise_deleted_constructor')}} co_return; } @@ -1377,7 +1372,7 @@ coro bad_coroutine_calls_with_no_matching_constructor(int, int) { - // expected-error@-1 {{call to deleted constructor of 'std::experimental::coroutine_traits, int, int>::promise_type' (aka 'CoroHandleMemberFunctionTest::bad_promise_no_matching_constructor')}} + // expected-error@-1 {{call to deleted constructor of 'std::coroutine_traits, int, int>::promise_type' (aka 'CoroHandleMemberFunctionTest::bad_promise_no_matching_constructor')}} co_return; } @@ -1393,7 +1388,7 @@ class awaitable_no_unused_warn { public: - using handle_type = std::experimental::coroutine_handle<>; + using handle_type = std::coroutine_handle<>; constexpr bool await_ready() noexcept { return false; } void await_suspend(handle_type) noexcept {} int await_resume() noexcept { return 1; } @@ -1402,7 +1397,7 @@ class awaitable_unused_warn { public: - using handle_type = std::experimental::coroutine_handle<>; + using handle_type = std::coroutine_handle<>; constexpr bool await_ready() noexcept { return false; } void await_suspend(handle_type) noexcept {} [[nodiscard]] int await_resume() noexcept { return 1; } @@ -1432,7 +1427,7 @@ } struct missing_await_ready { - void await_suspend(std::experimental::coroutine_handle<>); + void await_suspend(std::coroutine_handle<>); void await_resume(); }; struct missing_await_suspend { @@ -1441,7 +1436,7 @@ }; struct missing_await_resume { bool await_ready(); - void await_suspend(std::experimental::coroutine_handle<>); + void await_suspend(std::coroutine_handle<>); }; void test_missing_awaitable_members() { Index: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp =================================================================== --- clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp +++ clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp @@ -623,7 +623,6 @@ FileContentMappings M; M.push_back(std::make_pair("/coro_header", R"cpp( namespace std { -namespace experimental { template struct void_t_imp { @@ -642,7 +641,7 @@ template struct coroutine_traits : public traits_sfinae_base {}; -}} // namespace std::experimental +} // namespace std struct awaitable { bool await_ready() noexcept; template @@ -658,14 +657,13 @@ void unhandled_exception(); }; template -struct std::experimental::coroutine_traits { using promise_type = promise; }; +struct std::coroutine_traits { using promise_type = promise; }; namespace std { -namespace experimental { template struct coroutine_handle { static coroutine_handle from_address(void *) noexcept; }; -}} // namespace std::experimental +} // namespace std )cpp")); StringRef CoReturnCode = R"cpp( #include Index: libcxx/CMakeLists.txt =================================================================== --- libcxx/CMakeLists.txt +++ libcxx/CMakeLists.txt @@ -563,7 +563,7 @@ endif() if (LIBCXX_CONFIGURE_IDE) - # This simply allows IDE to process + # This simply allows IDE to process target_add_compile_flags_if_supported(${target} PRIVATE -fcoroutines-ts) endif() Index: libcxx/include/CMakeLists.txt =================================================================== --- libcxx/include/CMakeLists.txt +++ libcxx/include/CMakeLists.txt @@ -305,6 +305,7 @@ complex.h concepts condition_variable + coroutine csetjmp csignal cstdarg @@ -326,7 +327,6 @@ experimental/__config experimental/__memory experimental/algorithm - experimental/coroutine experimental/deque experimental/filesystem experimental/forward_list Index: libcxx/include/coroutine =================================================================== --- libcxx/include/coroutine +++ libcxx/include/coroutine @@ -7,17 +7,15 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_COROUTINE -#define _LIBCPP_EXPERIMENTAL_COROUTINE +#ifndef _LIBCPP_COROUTINE +#define _LIBCPP_COROUTINE /** - experimental/coroutine synopsis + coroutine synopsis // C++next namespace std { -namespace experimental { -inline namespace coroutines_v1 { // 18.11.1 coroutine traits template @@ -39,13 +37,11 @@ template struct hash; template struct hash>; -} // namespace coroutines_v1 -} // namespace experimental } // namespace std */ -#include +#include <__config> #include #include #include @@ -59,15 +55,15 @@ #ifdef _LIBCPP_HAS_NO_COROUTINES # if defined(_LIBCPP_WARNING) - _LIBCPP_WARNING(" cannot be used with this compiler") + _LIBCPP_WARNING(" cannot be used with this compiler") # else -# warning cannot be used with this compiler +# warning cannot be used with this compiler # endif #endif #ifndef _LIBCPP_HAS_NO_COROUTINES -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES +_LIBCPP_BEGIN_NAMESPACE_STD template struct __coroutine_traits_sfinae {}; @@ -315,13 +311,9 @@ void await_resume() const _NOEXCEPT {} }; -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES - -_LIBCPP_BEGIN_NAMESPACE_STD - template -struct hash<_VSTD_CORO::coroutine_handle<_Tp> > { - using __arg_type = _VSTD_CORO::coroutine_handle<_Tp>; +struct hash<_VSTD::coroutine_handle<_Tp> > { + using __arg_type = _VSTD::coroutine_handle<_Tp>; _LIBCPP_INLINE_VISIBILITY size_t operator()(__arg_type const& __v) const _NOEXCEPT {return hash()(__v.address());} @@ -331,4 +323,4 @@ #endif // !defined(_LIBCPP_HAS_NO_COROUTINES) -#endif /* _LIBCPP_EXPERIMENTAL_COROUTINE */ +#endif /* _LIBCPP_COROUTINE */ Index: libcxx/include/experimental/__config =================================================================== --- libcxx/include/experimental/__config +++ libcxx/include/experimental/__config @@ -45,14 +45,6 @@ #define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM \ } } _LIBCPP_END_NAMESPACE_EXPERIMENTAL -#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES \ - _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace coroutines_v1 { - -#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES \ - } _LIBCPP_END_NAMESPACE_EXPERIMENTAL - -#define _VSTD_CORO _VSTD_EXPERIMENTAL::coroutines_v1 - #define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD \ _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace parallelism_v2 { Index: libcxx/include/module.modulemap =================================================================== --- libcxx/include/module.modulemap +++ libcxx/include/module.modulemap @@ -849,7 +849,7 @@ } module coroutine { requires coroutines - header "experimental/coroutine" + header "coroutine" export * } module deque { Index: libcxx/test/libcxx/double_include.sh.cpp =================================================================== --- libcxx/test/libcxx/double_include.sh.cpp +++ libcxx/test/libcxx/double_include.sh.cpp @@ -199,7 +199,7 @@ #if __cplusplus >= 201103L # include # if defined(__cpp_coroutines) -# include +# include # endif # include # ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY Index: libcxx/test/libcxx/language.support/support.coroutines/dialect_support.pass.cpp =================================================================== --- libcxx/test/libcxx/language.support/support.coroutines/dialect_support.pass.cpp +++ libcxx/test/libcxx/language.support/support.coroutines/dialect_support.pass.cpp @@ -10,25 +10,23 @@ // REQUIRES: fcoroutines-ts // ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts -// A simple "breathing" test that checks that +// A simple "breathing" test that checks that // can be parsed and used in all dialects, including C++03 in order to match // Clang's behavior. -#include +#include #include "test_macros.h" -namespace coro = std::experimental::coroutines_v1; - -coro::suspend_always sa; -coro::suspend_never sn; +std::suspend_always sa; +std::suspend_never sn; struct MyFuture { struct promise_type { - typedef coro::coroutine_handle HandleT; - coro::suspend_never initial_suspend() { return sn; } - coro::suspend_always final_suspend() TEST_NOEXCEPT { return sa; } - coro::suspend_never yield_value(int) { return sn; } + typedef std::coroutine_handle HandleT; + std::suspend_never initial_suspend() { return sn; } + std::suspend_always final_suspend() TEST_NOEXCEPT { return sa; } + std::suspend_never yield_value(int) { return sn; } MyFuture get_return_object() { MyFuture f(HandleT::from_promise(*this)); return f; @@ -40,7 +38,7 @@ MyFuture() : p() {} MyFuture(HandleT h) : p(h) {} - coro::coroutine_handle p; + std::coroutine_handle p; }; MyFuture test_coro() { Index: libcxx/test/libcxx/language.support/support.coroutines/version.pass.cpp =================================================================== --- libcxx/test/libcxx/language.support/support.coroutines/version.pass.cpp +++ libcxx/test/libcxx/language.support/support.coroutines/version.pass.cpp @@ -11,7 +11,7 @@ // REQUIRES: fcoroutines-ts // ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts -#include +#include #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION must be defined Index: libcxx/test/libcxx/min_max_macros.compile.pass.cpp =================================================================== --- libcxx/test/libcxx/min_max_macros.compile.pass.cpp +++ libcxx/test/libcxx/min_max_macros.compile.pass.cpp @@ -315,7 +315,7 @@ # include TEST_MACROS(); # if defined(__cpp_coroutines) -# include +# include TEST_MACROS(); # endif # include Index: libcxx/test/libcxx/no_assert_include.compile.pass.cpp =================================================================== --- libcxx/test/libcxx/no_assert_include.compile.pass.cpp +++ libcxx/test/libcxx/no_assert_include.compile.pass.cpp @@ -194,7 +194,7 @@ #if __cplusplus >= 201103L # include # if defined(__cpp_coroutines) -# include +# include # endif # include # ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp @@ -9,16 +9,16 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; // namespace std { -// template struct hash>; +// template struct hash>; // } -#include +#include #include #include #include @@ -27,8 +27,6 @@ #include "test_macros.h" -namespace coro = std::experimental; - template void do_test(uintptr_t LHSVal, uintptr_t RHSVal) { const size_t ExpectLHS = std::hash{}(reinterpret_cast(LHSVal)); @@ -56,8 +54,8 @@ {8, 16} }; for (auto& TC : TestCases) { - do_test>(TC.first, TC.second); - do_test>(TC.first, TC.second); + do_test >(TC.first, TC.second); + do_test >(TC.first, TC.second); } return 0; Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp @@ -9,21 +9,19 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; // constexpr explicit operator bool() const noexcept -#include +#include #include #include #include "test_macros.h" -namespace coro = std::experimental; - template void do_test() { static_assert(std::is_nothrow_constructible::value, ""); @@ -52,8 +50,8 @@ int main(int, char**) { - do_test>(); - do_test>(); + do_test >(); + do_test >(); return 0; } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; @@ -17,7 +17,7 @@ // bool operator==(coroutine_handle<>, coroutine_handle<>) noexcept // bool operator!=(coroutine_handle<>, coroutine_handle<>) noexcept -#include +#include #include #include #include @@ -25,8 +25,6 @@ #include "test_macros.h" -namespace coro = std::experimental; - template void do_test(uintptr_t LHSVal, uintptr_t RHSVal) { const C LHS = C::from_address(reinterpret_cast(LHSVal)); @@ -53,8 +51,8 @@ {16, 0} }; for (auto& TC : TestCases) { - do_test>(TC.first, TC.second); - do_test>(TC.first, TC.second); + do_test >(TC.first, TC.second); + do_test >(TC.first, TC.second); } return 0; Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; @@ -19,7 +19,7 @@ // bool operator>=(coroutine_handle<>, coroutine_handle<>) noexcept // bool operator<=(coroutine_handle<>, coroutine_handle<>) noexcept -#include +#include #include #include #include @@ -27,8 +27,6 @@ #include "test_macros.h" -namespace coro = std::experimental; - template void do_test(uintptr_t LHSVal, uintptr_t RHSVal) { const C LHS = C::from_address(reinterpret_cast(LHSVal)); @@ -62,8 +60,8 @@ {16, 0} }; for (auto& TC : TestCases) { - do_test>(TC.first, TC.second); - do_test>(TC.first, TC.second); + do_test >(TC.first, TC.second); + do_test >(TC.first, TC.second); } return 0; Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; // bool done() const -#include +#include #include #include #include @@ -25,10 +25,8 @@ #include "test_macros.h" -namespace coro = std::experimental; - template -void do_test(coro::coroutine_handle const& H) { +void do_test(std::coroutine_handle const& H) { // FIXME Add a runtime test { ASSERT_SAME_TYPE(decltype(H.done()), bool); @@ -38,8 +36,8 @@ int main(int, char**) { - do_test(coro::coroutine_handle<>{}); - do_test(coro::coroutine_handle{}); + do_test(std::coroutine_handle<>{}); + do_test(std::coroutine_handle{}); return 0; } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp @@ -9,21 +9,19 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; // coroutine_handle& operator=(nullptr_t) noexcept -#include +#include #include #include #include "test_macros.h" -namespace coro = std::experimental; - template void do_test() { int dummy = 42; @@ -50,8 +48,8 @@ int main(int, char**) { - do_test>(); - do_test>(); + do_test >(); + do_test >(); return 0; } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; @@ -17,14 +17,12 @@ // constexpr coroutine_handle() noexcept // constexpr coroutine_handle(nullptr_t) noexcept -#include +#include #include #include #include "test_macros.h" -namespace coro = std::experimental; - template void do_test() { { @@ -49,8 +47,8 @@ int main(int, char**) { - do_test>(); - do_test>(); + do_test >(); + do_test >(); return 0; } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp @@ -9,21 +9,19 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; // constexpr void* address() const noexcept -#include +#include #include #include #include "test_macros.h" -namespace coro = std::experimental; - template void do_test() { { @@ -45,8 +43,8 @@ int main(int, char**) { - do_test>(); - do_test>(); + do_test >(); + do_test >(); return 0; } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; @@ -20,26 +20,24 @@ // FIXME: This behavior is an extension, and should upstreamed into the TS or // the test removed if the TS changes are rejected. -#include +#include #include #include -namespace coro = std::experimental; - int main(int, char**) { { - using H = coro::coroutine_handle<>; - // expected-error@experimental/coroutine:* 3 {{coroutine_handle::from_address cannot be called with non-void pointers}} + using H = std::coroutine_handle<>; + // expected-error@coroutine:* 3 {{coroutine_handle::from_address cannot be called with non-void pointers}} H::from_address((int*)nullptr); // expected-note {{requested here}} H::from_address((const void*)nullptr); // expected-note {{requested here}} H::from_address((const char*)nullptr); // expected-note {{requested here}} } { - using H = coro::coroutine_handle; - // expected-error@experimental/coroutine:* 1 {{static_assert failed "coroutine_handle::from_address cannot be used with pointers to the coroutine's promise type; use 'from_promise' instead"}} + using H = std::coroutine_handle; + // expected-error@coroutine:* 1 {{static_assert failed "coroutine_handle::from_address cannot be used with pointers to the coroutine's promise type; use 'from_promise' instead"}} H::from_address((const char*)nullptr); // expected-note {{requested here}} - // expected-error@experimental/coroutine:* 1 {{coroutine_handle::from_address cannot be called with non-void pointers}} + // expected-error@coroutine:* 1 {{coroutine_handle::from_address cannot be called with non-void pointers}} H::from_address((int*)nullptr); // expected-note {{requested here}} } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp @@ -9,21 +9,19 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; // static coroutine_handle from_address(void*) noexcept -#include +#include #include #include #include "test_macros.h" -namespace coro = std::experimental; - template void do_test() { { @@ -42,8 +40,8 @@ int main(int, char**) { - do_test>(); - do_test>(); + do_test >(); + do_test >(); return 0; } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp @@ -10,12 +10,12 @@ // UNSUPPORTED: c++03, c++11 // UNSUPPORTED: ubsan -// +// // struct noop_coroutine_promise; // using noop_coroutine_handle = coroutine_handle; // noop_coroutine_handle noop_coroutine() noexcept; -#include +#include #include #include @@ -23,11 +23,8 @@ #if __has_builtin(__builtin_coro_noop) -namespace coro = std::experimental::coroutines_v1; - - -static_assert(std::is_same, coro::noop_coroutine_handle>::value, ""); -static_assert(std::is_same::value, ""); +static_assert(std::is_same, std::noop_coroutine_handle>::value, ""); +static_assert(std::is_same::value, ""); // template <> struct coroutine_handle : coroutine_handle<> // { @@ -48,8 +45,8 @@ int main(int, char**) { - auto h = coro::noop_coroutine(); - coro::coroutine_handle<> base = h; + auto h = std::noop_coroutine(); + std::coroutine_handle<> base = h; assert(h); assert(base); @@ -66,7 +63,7 @@ h.promise(); assert(h.address() == base.address()); assert(h.address() != nullptr); - assert(coro::coroutine_handle<>::from_address(h.address()) == base); + assert(std::coroutine_handle<>::from_address(h.address()) == base); return 0; } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; // Promise& promise() const -#include +#include #include #include #include @@ -25,14 +25,12 @@ #include "test_macros.h" -namespace coro = std::experimental; - struct MyCoro { struct promise_type { void unhandled_exception() {} void return_void() {} - coro::suspend_never initial_suspend() { return {}; } - coro::suspend_never final_suspend() noexcept { return {}; } + std::suspend_never initial_suspend() { return {}; } + std::suspend_never final_suspend() noexcept { return {}; } MyCoro get_return_object() { do_runtime_test(); return {}; @@ -41,8 +39,8 @@ // Test that a coroutine_handle can be created from a const // promise_type and that it represents the same coroutine as // coroutine_handle - using CH = coro::coroutine_handle; - using CCH = coro::coroutine_handle; + using CH = std::coroutine_handle; + using CCH = std::coroutine_handle; const auto &cthis = *this; CH h = CH::from_promise(*this); CCH h2 = CCH::from_promise(*this); @@ -56,12 +54,10 @@ }; }; -MyCoro do_runtime_test() { - co_await coro::suspend_never{}; -} +MyCoro do_runtime_test() { co_await std::suspend_never{}; } template -void do_test(coro::coroutine_handle&& H) { +void do_test(std::coroutine_handle&& H) { // FIXME Add a runtime test { @@ -77,8 +73,8 @@ int main(int, char**) { - do_test(coro::coroutine_handle{}); - do_test(coro::coroutine_handle{}); + do_test(std::coroutine_handle{}); + do_test(std::coroutine_handle{}); do_runtime_test(); return 0; Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; // void destroy() -#include +#include #include #include #include @@ -25,8 +25,6 @@ #include "test_macros.h" -namespace coro = std::experimental; - template auto has_destroy_imp(H&& h, int) -> decltype(h.destroy(), std::true_type{}); template @@ -38,8 +36,8 @@ } template -void do_test(coro::coroutine_handle&& H) { - using HType = coro::coroutine_handle; +void do_test(std::coroutine_handle&& H) { + using HType = std::coroutine_handle; // FIXME Add a runtime test { ASSERT_SAME_TYPE(decltype(H.destroy()), void); @@ -55,8 +53,8 @@ int main(int, char**) { - do_test(coro::coroutine_handle<>{}); - do_test(coro::coroutine_handle{}); + do_test(std::coroutine_handle<>{}); + do_test(std::coroutine_handle{}); return 0; } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11 -// +// // template // struct coroutine_handle; @@ -17,7 +17,7 @@ // void operator()() // void resume() -#include +#include #include #include #include @@ -26,9 +26,6 @@ #include "test_macros.h" -namespace coro = std::experimental; - - template auto has_resume_imp(H&& h, int) -> decltype(h.resume(), std::true_type{}); template @@ -51,8 +48,8 @@ } template -void do_test(coro::coroutine_handle&& H) { - using HType = coro::coroutine_handle; +void do_test(std::coroutine_handle&& H) { + using HType = std::coroutine_handle; // FIXME Add a runtime test { ASSERT_SAME_TYPE(decltype(H.resume()), void); @@ -74,8 +71,8 @@ int main(int, char**) { - do_test(coro::coroutine_handle<>{}); - do_test(coro::coroutine_handle{}); + do_test(std::coroutine_handle<>{}); + do_test(std::coroutine_handle{}); return 0; } Index: libcxx/test/std/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp @@ -9,12 +9,10 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include "test_macros.h" -namespace coro = std::experimental; - struct A { using promise_type = A*; }; @@ -22,11 +20,11 @@ struct B {}; struct C {}; -namespace std { namespace experimental { - template <> - struct coroutine_traits<::A, int> { - using promise_type = int*; - }; +namespace std { +template <> +struct coroutine_traits< ::A, int> { + using promise_type = int*; +}; template struct coroutine_traits<::B, Args...> { using promise_type = B*; @@ -35,11 +33,11 @@ struct coroutine_traits<::C> { using promise_type = void; }; -}} + } // namespace std template void check_type() { - using P = typename coro::coroutine_traits::promise_type ; + using P = typename std::coroutine_traits::promise_type; static_assert(std::is_same::value, ""); }; Index: libcxx/test/std/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp @@ -9,12 +9,10 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include "test_macros.h" -namespace coro = std::experimental; - template constexpr bool has_promise_type(int) { return true; } template @@ -34,11 +32,11 @@ }; struct E {}; -namespace std { namespace experimental { - template <> - struct coroutine_traits<::A, int> { - using promise_type = int*; - }; +namespace std { +template <> +struct coroutine_traits< ::A, int> { + using promise_type = int*; +}; template struct coroutine_traits<::B, Args...> { using promise_type = B*; @@ -47,18 +45,18 @@ struct coroutine_traits<::C> { using promise_type = void; }; -}} + } // namespace std template void check_type() { - using Traits = coro::coroutine_traits; + using Traits = std::coroutine_traits; static_assert(has_promise_type(), ""); static_assert(std::is_same::value, ""); } template void check_no_type() { - using Traits = coro::coroutine_traits; + using Traits = std::coroutine_traits; static_assert(!has_promise_type(), ""); } Index: libcxx/test/std/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp @@ -9,15 +9,13 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include #include #include "test_macros.h" -namespace coro = std::experimental; - -using SuspendT = std::experimental::coroutines_v1::suspend_always; +using SuspendT = std::suspend_always; TEST_SAFE_STATIC SuspendT safe_sa; constexpr SuspendT constexpr_sa; @@ -33,7 +31,7 @@ int main(int, char**) { - using H = coro::coroutine_handle<>; + using H = std::coroutine_handle<>; using S = SuspendT; H h{}; S s{}; Index: libcxx/test/std/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp @@ -9,16 +9,14 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include #include #include "test_macros.h" -namespace coro = std::experimental; - // Test that the type is in the correct namespace -using SuspendT = std::experimental::coroutines_v1::suspend_never; +using SuspendT = std::suspend_never; TEST_SAFE_STATIC SuspendT safe_sn; constexpr SuspendT constexpr_sn; @@ -35,7 +33,7 @@ int main(int, char**) { - using H = coro::coroutine_handle<>; + using H = std::coroutine_handle<>; using S = SuspendT; H h{}; S s{}; Index: libcxx/test/std/language.support/support.coroutines/end.to.end/await_result.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/end.to.end/await_result.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/end.to.end/await_result.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include #include "test_macros.h" -using namespace std::experimental; +using namespace std; struct coro_t { struct promise_type { Index: libcxx/test/std/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp @@ -12,12 +12,12 @@ // See https://llvm.org/PR33271 // UNSUPPORTED: ubsan -#include +#include #include #include "test_macros.h" -using namespace std::experimental; +using namespace std; struct coro_t { struct promise_type { Index: libcxx/test/std/language.support/support.coroutines/end.to.end/expected.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/end.to.end/expected.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/end.to.end/expected.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include #include #include "test_macros.h" -using namespace std::experimental; +using namespace std; struct error_tag { }; Index: libcxx/test/std/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include #include "test_macros.h" -using namespace std::experimental; +using namespace std; int alive = 0; int ctor_called = 0; @@ -39,7 +39,7 @@ struct Bug { bool await_ready() { return true; } - void await_suspend(std::experimental::coroutine_handle<>) {} + void await_suspend(std::coroutine_handle<>) {} Noisy await_resume() { return {}; } }; struct coro2 { Index: libcxx/test/std/language.support/support.coroutines/end.to.end/generator.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/end.to.end/generator.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/end.to.end/generator.pass.cpp @@ -12,14 +12,14 @@ // See https://llvm.org/PR33271 // UNSUPPORTED: ubsan -#include +#include #include #include #include "test_macros.h" #include "coroutine_types.h" -using namespace std::experimental; +using namespace std; struct minig { struct promise_type { Index: libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include #include "test_macros.h" -using namespace std::experimental; +using namespace std; bool cancel = false; Index: libcxx/test/std/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include #include "test_macros.h" -using namespace std::experimental; +using namespace std; // This file tests, multishot, movable std::function like thing using coroutine // for compile-time type erasure and unerasure. Index: libcxx/test/std/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++03, c++11 -#include +#include #include #include #include "test_macros.h" -using namespace std::experimental; +using namespace std; // This file tests, one shot, movable std::function like thing using coroutine // for compile-time type erasure and unerasure. Index: libcxx/test/std/language.support/support.coroutines/includes.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.coroutines/includes.pass.cpp +++ libcxx/test/std/language.support/support.coroutines/includes.pass.cpp @@ -9,11 +9,11 @@ // UNSUPPORTED: c++03, c++11 -// +// -// Test that includes +// Test that includes -#include +#include int main(int, char**) { // std::nothrow is not implicitly defined by the compiler when the include is Index: libcxx/test/support/coroutine_types.h =================================================================== --- libcxx/test/support/coroutine_types.h +++ libcxx/test/support/coroutine_types.h @@ -10,28 +10,27 @@ #ifndef SUPPORT_COROUTINE_TYPES_H #define SUPPORT_COROUTINE_TYPES_H -#include +#include template struct generator { struct promise_type { Ty current_value; - std::experimental::suspend_always yield_value(Ty value) { + std::suspend_always yield_value(Ty value) { this->current_value = value; return {}; } - std::experimental::suspend_always initial_suspend() { return {}; } - std::experimental::suspend_always final_suspend() noexcept { return {}; } + std::suspend_always initial_suspend() { return {}; } + std::suspend_always final_suspend() noexcept { return {}; } generator get_return_object() { return generator{this}; }; void return_void() {} void unhandled_exception() {} }; struct iterator { - std::experimental::coroutine_handle _Coro; + std::coroutine_handle _Coro; bool _Done; - iterator(std::experimental::coroutine_handle Coro, bool Done) - : _Coro(Coro), _Done(Done) {} + iterator(std::coroutine_handle Coro, bool Done) : _Coro(Coro), _Done(Done) {} iterator &operator++() { _Coro.resume(); @@ -65,10 +64,9 @@ } private: - explicit generator(promise_type *p) - : p(std::experimental::coroutine_handle::from_promise(*p)) {} + explicit generator(promise_type* p) : p(std::coroutine_handle::from_promise(*p)) {} - std::experimental::coroutine_handle p; + std::coroutine_handle p; }; #endif // SUPPORT_COROUTINE_TYPES_H Index: libcxx/utils/generate_header_tests.py =================================================================== --- libcxx/utils/generate_header_tests.py +++ libcxx/utils/generate_header_tests.py @@ -50,7 +50,7 @@ "streambuf": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"], "strstream": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"], - "experimental/coroutine": ["if defined(__cpp_coroutines)"], + "coroutine": ["if defined(__cpp_coroutines)"], "experimental/regex": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"], }