Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Adding some potential reviewers.
I'm open to testing this some way other than through clangd, but note that, while the issue is not in AST serialization code, it only trips an assertion after a serialization round-trip.
As for testing strategy, after this change the AST should look different. You can probably modify clang/test/SemaTemplate/deduction-guide.cpp to check for existence of requires clauses in the implicitly generated function templates for guides.
Fantastic, thank you!
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp | ||
---|---|---|
794 ↗ | (On Diff #416827) | Having solved and tested this in the AST, this test is arguably redundant (it's not like there's anything interesting going on in de/serialization). Happy if you want to keep it as a regression test, maybe leave a comment that we used to crash here or linking to the bug? |
clang/test/SemaTemplate/deduction-guide.cpp | ||
219 | Before your patch, clang requires this explicit deduction guide in order to accept the code. After your patch, clang accepts this code without the explicit deduction guide. (Kadir and I spent some time poking at variations of this example to understand how CTAD works in the AST, so thanks for this!) |
Before your patch, clang requires this explicit deduction guide in order to accept the code.
Without it, it says the two implicit deduction guides from the constructor are ambiguous. But this is precisely because they lack the constraints!
After your patch, clang accepts this code without the explicit deduction guide.
So I think omitting the guide (and having no expected-error...) makes it a better test - in addition to verifying the guides can be dumped, it checks they are used.
(Kadir and I spent some time poking at variations of this example to understand how CTAD works in the AST, so thanks for this!)