[PATCH] D110216: [clang] retain type sugar in auto / template argument deduction

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 23 10:16:57 PDT 2021


mizvekov created this revision.
Herald added a subscriber: jdoerfert.
mizvekov updated this revision to Diff 374246.
mizvekov added a comment.
mizvekov updated this revision to Diff 374365.
Herald added subscribers: kbarton, nemanjai.
mizvekov updated this revision to Diff 374395.
Herald added subscribers: usaxena95, kadircet, arphaman.
mizvekov updated this revision to Diff 374401.
mizvekov updated this revision to Diff 374407.
mizvekov updated this revision to Diff 374590.
mizvekov added a comment.
Herald added a subscriber: martong.
Herald added a reviewer: shafik.
mizvekov updated this revision to Diff 374603.
mizvekov published this revision for review.
Herald added projects: clang, clang-tools-extra.
Herald added a subscriber: cfe-commits.

.


mizvekov added a comment.

.


mizvekov added a comment.

..


mizvekov added a comment.

.


mizvekov added a comment.

.


mizvekov added a comment.

.


This implements the following changes:

- AutoType retains sugared deduced-as-type.
- Template argument deduction machinery analyses the sugared type all the way

down. It would previously lose the sugar on first recursion.

- Undeduced AutoType will be properly canonicalized, including the constraint

template arguments.

As a result, we start seeing sugared types in a lot more test cases,
including some which showed very unfriendly `type-parameter-*-*` types.

Depends on D110210 <https://reviews.llvm.org/D110210>

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110216

Files:
  clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp
  clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
  clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp
  clang-tools-extra/clangd/XRefs.cpp
  clang-tools-extra/clangd/unittests/ASTTests.cpp
  clang-tools-extra/clangd/unittests/HoverTests.cpp
  clang-tools-extra/clangd/unittests/InlayHintTests.cpp
  clang-tools-extra/clangd/unittests/tweaks/ExpandAutoTypeTests.cpp
  clang-tools-extra/test/clang-tidy/checkers/cert-static-object-exception.cpp
  clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-owning-memory.cpp
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/AST/Type.h
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/ASTImporter.cpp
  clang/lib/AST/Type.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaInit.cpp
  clang/lib/Sema/SemaLambda.cpp
  clang/lib/Sema/SemaStmt.cpp
  clang/lib/Sema/SemaTemplate.cpp
  clang/lib/Sema/SemaTemplateDeduction.cpp
  clang/lib/Sema/TreeTransform.h
  clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-cxx14.cpp
  clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-cxx14.cpp
  clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
  clang/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
  clang/test/CXX/temp/temp.decls/temp.variadic/multi-level-substitution.cpp
  clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p1-0x.cpp
  clang/test/Index/print-type.cpp
  clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp
  clang/test/SemaCXX/cxx1z-decomposition.cpp
  clang/test/SemaCXX/deduced-return-type-cxx14.cpp
  clang/test/SemaCXX/friend.cpp
  clang/test/SemaCXX/recovery-expr-type.cpp
  clang/test/SemaCXX/sizeless-1.cpp
  clang/test/SemaCXX/sugared-auto.cpp
  clang/test/SemaTemplate/attributes.cpp
  clang/test/SemaTemplate/friend.cpp
  clang/test/SemaTemplate/operator-template.cpp
  clang/unittests/AST/ASTImporterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110216.374603.patch
Type: text/x-patch
Size: 100667 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210923/7afd1524/attachment-0001.bin>


More information about the cfe-commits mailing list