[clang] Evaluate non-type default template argument when it is required
authorMariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Tue, 9 May 2023 07:43:59 +0000 (03:43 -0400)
committerMariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Tue, 9 May 2023 08:21:46 +0000 (04:21 -0400)
commit74fd474eea53e85fc8f64422f565fd2bd50fd7e4
treef59c5c14f0562d1350fbbc7f3a89de3aaec29ab7
parentcac4d7ff4652815e12132c990a62d68873ba4b9e
[clang] Evaluate non-type default template argument when it is required

Before this change a default template argument for a non-type template
parameter was evaluated and checked immediately after it is met by
parser. In some cases it is too early.

Fixes https://github.com/llvm/llvm-project/issues/62224
Fixes https://github.com/llvm/llvm-project/issues/62596

Reviewed By: shafik, erichkeane, cor3ntin

Differential Revision: https://reviews.llvm.org/D150108
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaTemplate.cpp
clang/test/AST/ast-dump-decl.cpp
clang/test/CXX/expr/expr.const/p3-0x.cpp
clang/test/Index/Core/index-source.cpp
clang/test/SemaCXX/GH62596.cpp [new file with mode: 0644]
clang/test/SemaCXX/cxx2a-consteval-default-params.cpp
clang/test/SemaTemplate/deduction-guide.cpp
clang/test/SemaTemplate/temp_arg_nontype.cpp
clang/unittests/AST/ASTImporterTest.cpp