[PATCH] D107595: [clang] fix transformation of template arguments for concept specializations

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 5 13:21:56 PDT 2021


mizvekov created this revision.
mizvekov published this revision for review.
mizvekov added a reviewer: rsmith.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

See PR50864.

This fixes error caused by substitution failures on template arguments
for concept specializations. With this patch, in such cases, the concept
specialization will evaluate to false instead.

As a bonus, we:

- Remove some memory leak as an std::string was being stored in the AST.
- Remove some duplicate implementation of serialization (as string) of substitution diagnostics for concepts.
- Fix some cases where we would try to take a SFINAE diagnostic without checking if there was one first.

Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107595

Files:
  clang/include/clang/AST/ASTConcept.h
  clang/include/clang/AST/ExprConcepts.h
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/ASTConcept.cpp
  clang/lib/Sema/SemaConcept.cpp
  clang/lib/Sema/SemaTemplateInstantiate.cpp
  clang/lib/Sema/TreeTransform.h
  clang/lib/Serialization/ASTWriterStmt.cpp
  clang/test/SemaTemplate/concepts.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107595.364581.patch
Type: text/x-patch
Size: 20870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210805/0e7757f5/attachment-0001.bin>


More information about the cfe-commits mailing list