[clang] Instantiate NTTPs and template default arguments with sugar
authorMatheus Izvekov <mizvekov@gmail.com>
Sun, 23 Oct 2022 11:41:57 +0000 (13:41 +0200)
committerMatheus Izvekov <mizvekov@gmail.com>
Thu, 27 Oct 2022 04:18:12 +0000 (06:18 +0200)
commitd4b1964f0554046b1e64908e5c1cd701b25f4c9e
tree5f7916fe2f7cbe992680caca80700ea9440eb3e2
parent326feaafb0913ec6b21d1d89d09cbdbb40db7503
[clang] Instantiate NTTPs and template default arguments with sugar

This makes use of the changes introduced in D134604, in order to
instantiate non-type template parameters and default template arguments
with a final sugared substitution.

This comes at no additional relevant cost.
Since we don't track / unique them in specializations, we wouldn't be
able to resugar them later anyway.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136564
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/test/AST/ast-dump-template-decls.cpp
clang/test/CXX/drs/dr3xx.cpp
clang/test/CXX/expr/expr.const/p3-0x.cpp
clang/test/Misc/diag-template-diffing.cpp
clang/test/SemaTemplate/instantiation-default-1.cpp
clang/test/SemaTemplate/make_integer_seq.cpp