[all-commits] [llvm/llvm-project] 740a16: PR46377: Fix dependence calculation for function t...

Richard Smith via All-commits all-commits at lists.llvm.org
Tue Jul 28 13:23:37 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 740a164dec483225cbd02ab6c82199e2747ffacb
      https://github.com/llvm/llvm-project/commit/740a164dec483225cbd02ab6c82199e2747ffacb
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-07-28 (Tue, 28 Jul 2020)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/Type.h
    M clang/include/clang/Basic/TypeNodes.td
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaLambda.cpp
    M clang/lib/Sema/SemaTemplateVariadic.cpp
    M clang/lib/Sema/SemaType.cpp
    A clang/test/SemaTemplate/alias-template-nondependent.cpp

  Log Message:
  -----------
  PR46377: Fix dependence calculation for function types and typedef
types.

We previously did not treat a function type as dependent if it had a
parameter pack with a non-dependent type -- such a function type depends
on the arity of the pack so is dependent even though none of the
parameter types is dependent. In order to properly handle this, we now
treat pack expansion types as always being dependent types (depending on
at least the pack arity), and always canonically being pack expansion
types, even in the unusual case when the pattern is not a dependent
type. This does mean that we can have canonical types that are pack
expansions that contain no unexpanded packs, which is unfortunate but
not inaccurate.

We also previously did not treat a typedef type as
instantiation-dependent if its canonical type was not
instantiation-dependent. That's wrong because instantiation-dependence
is a property of the type sugar, not of the type; an
instantiation-dependent type can have a non-instantiation-dependent
canonical type.




More information about the All-commits mailing list