Add type information to integral template argument if required.
authorPratyush Das <reikdas@gmail.com>
Wed, 12 May 2021 17:28:41 +0000 (17:28 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Wed, 12 May 2021 19:00:08 +0000 (19:00 +0000)
commit99d63ccff04b672694f8a2b3eed024b873dc163d
tree29d50ea6fe6e1b197a1e7b0ea38b536f231751e6
parentd8c227ba05d065046bdb8671f1df73dabaffa222
Add type information to integral template argument if required.

Non-comprehensive list of cases:
 * Dumping template arguments;
 * Corresponding parameter contains a deduced type;
 * Template arguments are for a DeclRefExpr that hadMultipleCandidates()

Type information is added in the form of prefixes (u8, u, U, L),
suffixes (U, L, UL, LL, ULL) or explicit casts to printed integral template
argument, if MSVC codeview mode is disabled.

Differential revision: https://reviews.llvm.org/D77598
38 files changed:
clang-tools-extra/clangd/Hover.cpp
clang/include/clang/AST/DeclTemplate.h
clang/include/clang/AST/Expr.h
clang/include/clang/AST/StmtDataCollectors.td
clang/include/clang/AST/TemplateBase.h
clang/lib/AST/ASTTypeTraits.cpp
clang/lib/AST/DeclPrinter.cpp
clang/lib/AST/DeclTemplate.cpp
clang/lib/AST/Expr.cpp
clang/lib/AST/NestedNameSpecifier.cpp
clang/lib/AST/StmtPrinter.cpp
clang/lib/AST/TemplateBase.cpp
clang/lib/AST/TypePrinter.cpp
clang/lib/Analysis/PathDiagnostic.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/test/Analysis/eval-predefined-exprs.cpp
clang/test/CXX/lex/lex.literal/lex.ext/p12.cpp
clang/test/CXX/lex/lex.literal/lex.ext/p13.cpp [new file with mode: 0644]
clang/test/CXX/lex/lex.literal/lex.ext/p14.cpp [new file with mode: 0644]
clang/test/CodeGenCXX/debug-info-codeview-template-literal.cpp [new file with mode: 0644]
clang/test/CodeGenCXX/debug-info-codeview-template-type.cpp [new file with mode: 0644]
clang/test/SemaCXX/builtin-align-cxx.cpp
clang/test/SemaCXX/cxx11-ast-print.cpp
clang/test/SemaCXX/cxx1z-ast-print.cpp [new file with mode: 0644]
clang/test/SemaCXX/matrix-type-builtins.cpp
clang/test/SemaCXX/matrix-type-operators.cpp
clang/test/SemaTemplate/address_space-dependent.cpp
clang/test/SemaTemplate/default-arguments-ast-print.cpp [new file with mode: 0644]
clang/test/SemaTemplate/delegating-constructors.cpp
clang/test/SemaTemplate/matrix-type.cpp
clang/test/SemaTemplate/temp_arg_enum_printing.cpp
clang/test/SemaTemplate/temp_arg_nontype.cpp
clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
clang/tools/libclang/CIndex.cpp
clang/unittests/Tooling/RecursiveASTVisitorTests/TemplateArgumentLocTraverser.cpp