[all-commits] [llvm/llvm-project] b5f2c4: PR23029 / C++ DR2233: Allow expanded parameter pac...

Richard Smith via All-commits all-commits at lists.llvm.org
Tue Jun 2 13:49:19 PDT 2020


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

  Changed paths:
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/Sema/Template.h
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx03-extra-copy.cpp
    M clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx0x-no-extra-copy.cpp
    M clang/test/CXX/drs/dr0xx.cpp
    M clang/test/CXX/drs/dr1xx.cpp
    M clang/test/CXX/drs/dr22xx.cpp
    M clang/test/CXX/drs/dr7xx.cpp
    A clang/test/CXX/expr/expr.post/expr.call/p4.cpp
    M clang/test/SemaCXX/abstract.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp
    M clang/test/SemaCXX/decl-init-ref.cpp
    M clang/test/SemaCXX/implicit-exception-spec.cpp
    M clang/test/SemaCXX/warn-bool-conversion.cpp
    M clang/www/cxx_dr_status.html

  Log Message:
  -----------
  PR23029 / C++ DR2233: Allow expanded parameter packs to follow
parameters with default arguments.

Directly follow the wording by relaxing the AST invariant that all
parameters after one with a default arguemnt also have default
arguments, and removing the diagnostic on missing default arguments
on a pack-expanded parameter following a parameter with a default
argument.

Testing also revealed that we need to special-case explicit
specializations of templates with a pack following a parameter with a
default argument, as such explicit specializations are otherwise
impossible to write. The standard wording doesn't address this case; a
issue has been filed.

This exposed a bug where we would briefly consider a parameter to have
no default argument while we parse a delay-parsed default argument for
that parameter, which is also fixed.

Partially incorporates a patch by Raul Tambre.




More information about the All-commits mailing list