diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -2445,6 +2445,8 @@ TInfo->getType(), TInfo, LocEnd, Ctor); Guide->setImplicit(); Guide->setParams(Params); + if (Ctor && Ctor->getTrailingRequiresClause()) + Guide->setTrailingRequiresClause(Ctor->getTrailingRequiresClause()); for (auto *Param : Params) Param->setDeclContext(Guide); diff --git a/clang/test/CXX/drs/dr26xx.cpp b/clang/test/CXX/drs/dr26xx.cpp new file mode 100644 --- /dev/null +++ b/clang/test/CXX/drs/dr26xx.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify + +namespace dr2628 { // dr2628: yes + +template +struct foo { + constexpr foo() requires (!A && !B) = delete; // expected-note {{marked deleted here}} + constexpr foo() requires (A || B) = delete; +}; + +void f() { + foo fooable; // expected-error {{call to deleted}} +} + +}