[all-commits] [llvm/llvm-project] c36b03: The type of a reference to a non-type template par...

Richard Smith via All-commits all-commits at lists.llvm.org
Thu Jun 18 17:52:31 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c36b03e32556a966e584386ac7dbb110bc7e4bc5
      https://github.com/llvm/llvm-project/commit/c36b03e32556a966e584386ac7dbb110bc7e4bc5
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-06-18 (Thu, 18 Jun 2020)

  Changed paths:
    M clang/include/clang/AST/Type.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/AST/ast-dump-expr-json.cpp
    M clang/test/AST/ast-dump-expr.cpp
    M clang/test/Import/pack-expansion-expr/test.cpp
    M clang/test/SemaTemplate/temp_arg_nontype.cpp

  Log Message:
  -----------
  The type of a reference to a non-type template parameter pack should
not be a pack expansion type.

Using a pack expansion type for a pack declaration makes sense, but
general expressions should never have pack expansion types. If we have a
pack `T *...V`, then the type of `V` is the type `T *`, which contains
an unexpanded pack, and is a pointer type.

This allows us to better diagnose issues where a template is invalid due
to some non-dependent portion of a dependent type of a non-type template
parameter pack.




More information about the All-commits mailing list