Skip to content

Commit

Permalink
Revert "[Clang] Implement fix for DR2628"
Browse files Browse the repository at this point in the history
This reverts commit 368b683.
  • Loading branch information
tru committed Feb 24, 2023
1 parent eb9440b commit 233479f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
5 changes: 0 additions & 5 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -833,11 +833,6 @@ Concepts Specific Fixes:
- Fixed an issue with concept requirement evaluation, where we incorrectly allowed implicit
conversions to bool for a requirement. (`#54524 <https://github.com/llvm/llvm-project/issues/54524>`_)

- Respect constructor constraints during class template argument deduction (CTAD).
This is the suggested resolution to CWG DR2628.
(`#57646 <https://github.com/llvm/llvm-project/issues/57646>`_,
`#43829 <https://github.com/llvm/llvm-project/issues/43829>`_)

- Fix a crash when emitting a concept-related diagnostic.
(`#57415 <https://github.com/llvm/llvm-project/issues/57415>`_)

Expand Down
2 changes: 0 additions & 2 deletions clang/lib/Sema/SemaTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2540,8 +2540,6 @@ struct ConvertConstructorToDeductionGuideTransform {
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);
Expand Down
16 changes: 11 additions & 5 deletions clang/test/CXX/drs/dr26xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@ using enum E; // expected-error {{unknown type name E}}
}
}

namespace dr2628 { // dr2628: yes open
namespace dr2628 { // dr2628: no, this was reverted for the 16.x release
// due to regressions, see the issue for more details:
// https://github.com/llvm/llvm-project/issues/60777

template <bool A = false, bool B = false>
struct foo {
constexpr foo() requires (!A && !B) = delete; // #DR2628_CTOR
constexpr foo() requires (A || B) = delete;
// The expected notes below should be removed when dr2628 is fully implemented again
constexpr foo() requires (!A && !B) = delete; // expected-note {{candidate function [with A = false, B = false]}} #DR2628_CTOR
constexpr foo() requires (A || B) = delete; // expected-note {{candidate function [with A = false, B = false]}}
};

void f() {
foo fooable; // expected-error {{call to deleted}}
// expected-note@#DR2628_CTOR {{marked deleted here}}
// The FIXME's below should be the expected errors when dr2628 is
// fully implemented again.
// FIXME-expected-error {{call to deleted}}
foo fooable; // expected-error {{ambiguous deduction for template arguments of 'foo'}}
// FIXME-expected-note@#DR2628_CTOR {{marked deleted here}}
}

}
Expand Down

0 comments on commit 233479f

Please sign in to comment.