llvm-capstone/clang/lib/Index
Andrey Ali Khan Bolshakov 5518a9d767
[c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (#78041)
Previously committed as 9e08e51a20, and
reverted because a dependency commit was reverted, then committed again
as 4b574008ae and reverted again because
"dependency commit" 5a391d38ac was
reverted. But it doesn't seem that 5a391d38ac was a real dependency
for this.

This commit incorporates 4b574008ae and
18e093faf7 by Richard Smith (@zygoloid),
with some minor fixes, most notably:

- `UncommonValue` renamed to `StructuralValue`

- `VK_PRValue` instead of `VK_RValue` as default kind in lvalue and
member pointer handling branch in
`BuildExpressionFromNonTypeTemplateArgumentValue`;

- handling of `StructuralValue` in `IsTypeDeclaredInsideVisitor`;

- filling in `SugaredConverted` along with `CanonicalConverted`
parameter in `Sema::CheckTemplateArgument`;

- minor cleanup in
`TemplateInstantiator::transformNonTypeTemplateParmRef`;

- `TemplateArgument` constructors refactored;

- `ODRHash` calculation for `UncommonValue`;

- USR generation for `UncommonValue`;

- more correct MS compatibility mangling algorithm (tested on MSVC ver.
19.35; toolset ver. 143);

- IR emitting fixed on using a subobject as a template argument when the
corresponding template parameter is used in an lvalue context;

- `noundef` attribute and opaque pointers in `template-arguments` test;

- analysis for C++17 mode is turned off for templates in
`warn-bool-conversion` test; in C++17 and C++20 mode, array reference
used as a template argument of pointer type produces template argument
of UncommonValue type, and
`BuildExpressionFromNonTypeTemplateArgumentValue` makes
`OpaqueValueExpr` for it, and `DiagnoseAlwaysNonNullPointer` cannot see
through it; despite of "These cases should not warn" comment, I'm not
sure about correct behavior; I'd expect a suggestion to replace `if` by
`if constexpr`;

- `temp.arg.nontype/p1.cpp` and `dr18xx.cpp` tests fixed.
2024-01-21 21:28:57 +01:00
..
CMakeLists.txt cmake: add missing dependencies on ClangDriverOptions tablegen 2023-08-04 10:27:19 -07:00
CommentToXML.cpp [clang][NFC] Refactor ParamCommandComment::PassDirection 2023-11-06 22:55:51 +03:00
FileIndexRecord.cpp Use llvm::erase_if (NFC) 2022-08-13 12:55:48 -07:00
FileIndexRecord.h
IndexBody.cpp [clang][index] Fix processing of CompoundAssignOperator at setting up reference roles (#69370) 2023-10-19 23:09:31 +03:00
IndexDecl.cpp [clangd] Index the type of a non-type template parameter 2023-06-20 03:22:52 -04:00
IndexingAction.cpp Revert "[clang] Convert OptionalFileEntryRefDegradesToFileEntryPtr to std::optional" 2022-12-18 11:23:54 -08:00
IndexingContext.cpp [clang] [libIndex] Remove unused 'RefD' parameter of IndexingContext::handleReference() 2023-07-28 21:36:27 -04:00
IndexingContext.h [clang] [libIndex] Remove unused 'RefD' parameter of IndexingContext::handleReference() 2023-07-28 21:36:27 -04:00
IndexSymbol.cpp [clang] Use StringRef::{starts,ends}_with (NFC) (#75149) 2023-12-13 08:54:13 -08:00
IndexTypeSourceInfo.cpp [Index] [clangd] Support for concept declarations and requires expressions 2022-04-26 13:50:01 +00:00
USRGeneration.cpp [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (#78041) 2024-01-21 21:28:57 +01:00